@@ -24,35 +24,39 @@ Arrays
24
24
4 . Shift array of integers circularly given input array and shift size.
25
25
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/circularshiftintarray/CircularShiftArray.java
26
26
27
- 5 . Check if a sub-array exists in parent array.
27
+ 5 . Given a boolean matrix mat[ M] [ N ] of size M X N, modify it such that if a matrix cell mat[ i] [ j ] is 1 (or true)
28
+ then make all the cells of ith row and jth column as 1.
29
+ Link:
30
+
31
+ 6 . Check if a sub-array exists in parent array.
28
32
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/findarray/FindArrayImpl.java
29
33
30
- 6 . Find duplicates count in sorted array.
34
+ 7 . Find duplicates count in sorted array.
31
35
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/findduplicatecountsortedarray/DuplicatesCountInSortedArray.java
32
36
33
- 7 . Write a program takes array input{1,0,2,3} and num = 3 and provides output {1,2}{0,3}{2,1}{3,0} sum equals the num.
37
+ 8 . Write a program takes array input{1,0,2,3} and num = 3 and provides output {1,2}{0,3}{2,1}{3,0} sum equals the num.
34
38
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/findpairsequaltosum/FindPairsEqualToSum.java
35
39
36
- 8 . Given a sorted array (ascending order and distinct elements), find i such that inputArr[ i] = i. Return -1 if nothing found.
40
+ 9 . Given a sorted array (ascending order and distinct elements), find i such that inputArr[ i] = i. Return -1 if nothing found.
37
41
Link:
38
42
39
- 9 . Find the contiguous subarray which has the largest sum. Kadane's algorithm.
43
+ 10 . Find the contiguous subarray which has the largest sum. Kadane's algorithm.
40
44
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/maxsubarray/FindMaxSubArray.java
41
45
42
- 10 . Given two sorted (ascending) arrays of integers, find the minimum difference between two integers in that array.
46
+ 11 . Given two sorted (ascending) arrays of integers, find the minimum difference between two integers in that array.
43
47
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/mindiffsortedarrays/MinimumDifferenceSortedArrays.java
44
48
45
- 11 . Print numbers with frequency.
49
+ 12 . Print numbers with frequency.
46
50
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/numberfrequency/PrintNumbersWithFrequency.java
47
51
48
- 12 . Find Number with Highest frequency in sorted array.
52
+ 13 . Find Number with Highest frequency in sorted array.
49
53
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/numberwithhighestfreq/FindNumberWithHighestFreq.java
50
54
51
- 13 . Given an array, write a program to generate a random permutation of array elements.
55
+ 14 . Given an array, write a program to generate a random permutation of array elements.
52
56
Also asked as “shuffle a deck of cards” or “randomize a given array”.
53
57
Link:
54
58
55
- 14 . Search for a number in rotated sorted array (Ascending or Descending).
59
+ 15 . Search for a number in rotated sorted array (Ascending or Descending).
56
60
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/searchrotatedsortedarray/SearchInRotatedSortedArray.java
57
61
58
62
0 commit comments