March 16, 2016 Problem statement:Given a 2D array (matrix) named M, print all items of M in a spiral order, clockwise.For example: M = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 The clockwise spiral pr…
Pramp - mock interview experience February 23, 2016 Read the article today from hackerRank blog on facebook: http://venturebeat.com/2016/02/18/how-i-landed-a-google-internship-in-6-months/?utm_content=buffer5c137&utm_medium=social&utm_source=fac…
LeetCode Top Interview Questions https://leetcode.com/problemset/top-interview-questions/ # No. Title Acceptance Difficulty 1 1 Two Sum 38.80% Easy 2 2 Add Two Numbers 29.10% Medium 3 3 Longest Substring Without Repeating Characters 25.00% Medium 4 4…
Given an array with integers. Find two non-overlapping subarrays A and B, which |SUM(A) - SUM(B)| is the largest. Return the largest difference. 1,-2,3,-1 1,3 A -1 B 7 public int maxDiffSubArrays(int[] nums) { // write your code here } Solution: publ…
package com.company; import java.util.LinkedList; import java.util.List; public class Main { public int[] twoSum(int[] numbers, int target) { int i = 0, j = numbers.length - 1; int []ret = new int[2]; while (i < j) { if (numbers[i] + numbers[j] < ta…