IBM OA Standard – Back-End – IBM OA 真题 – 一亩三分地 – VO support – OA 代写 – 面试代面

Question 1: Price Check

Problem Statement

A shop with old-style cash registers records the price of each item manually, which can lead to errors. Given:

  • A list of product names and their correct prices.
  • A list of products sold and their respective entered prices.

Task: Determine the number of errors in the recorded selling prices.

Example

Input:

products = ['eggs', 'milk', 'cheese']  
productPrices = [2.89, 3.29, 5.79]
productSold = ['eggs', 'eggs', 'cheese', 'milk']
soldPrice = [2.89, 2.99, 5.97, 3.29]

Output:

Errors = 2

Explanation:

  • The second sale of 'eggs' and the sale of 'cheese' have incorrect prices.
  • Total errors = 2.

Function Description

Complete the function priceCheck(products, productPrices, productSold, soldPrice).

Parameters:

  1. products[n]: Names of items for sale.
  2. productPrices[n]: Correct price of each item.
  3. productSold[m]: Names of sold products.
  4. soldPrice[m]: Recorded prices of sold products.

Returns:

  • int: Number of errors in selling prices.

Constraints:

  • 1 ≤ n ≤ 100000
  • 1 ≤ m ≤ n
  • 1.00 ≤ productPrices[i], soldPrice[i] ≤ 100000.00

Question 2: Missing Words

Problem Statement

Given two strings s and t:

  • t is a subsequence of s.
  • Identify the words in s that are missing from t while preserving their order in s.

Task: Return the list of missing words.

Example

Input:

s = "I am using HackerRank to improve programming"  
t = "am HackerRank to improve"

Output:

['I', 'using', 'programming']

Explanation:

  • The missing words in s but not in t are: 'I', 'using', 'programming'.

Function Description

Complete the function missingWords(s, t).

Parameters:

  1. s: A sentence of space-separated words.
  2. t: A sentence of space-separated words.

Returns:

  • string[]: List of words in s missing from t, in order of occurrence.

Constraints:

  • Strings s and t contain only English alphabetic letters (a-z, A-Z), dashes (-), and spaces.
  • 1 ≤ |t| ≤ |s| ≤ 1000000
  • 1 ≤ length of any word in s or t ≤ 15

我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。

We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

Leave a Reply

Your email address will not be published. Required fields are marked *