Bob at the Bank Solution Codechef

Bob at the Bank Solution Codechef Bob has an account in the Bobby Bank. His current account balance is W rupees. Each month, the office in which Bob works deposits a fixed amount of X rupees to his account.Y rupees is deducted from Bob’s account each month as bank charges. Find his final account balance … Read more

Largest Subarray Google OA Solution

Largest Subarray Google OA Solution

Largest Subarray Google OA Solution Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: [4,-1,2,1] has the largest sum = 6. Example 2: Input: nums = [1] Output: 1 … Read more

Compare Strings Google OA Solution

Compare Strings Google OA Solution

Compare Strings Google OA Solution One string is strictly smaller than another when the frequency of occurrence of the smallest character in the string is less than the frequency of the smallest character in the string is less than the frequency of occurrence of the smallest character in the comparison string. For example, string “abcd” … Read more