Skip to content

Latest commit

 

History

History

Practice

What's Next?

Let's recap what we looked at in this repo:

  • We explored what the Array data structure is all about.
  • We looked at the Java syntax for creating Arrays.
  • We looked at the Java syntax for reading and writing from Arrays.
  • We designed basic insertion, deletion, and search algorithms for Arrays.
  • We played around with in-place Array algorithms.
  • We solved heaps of fun and exciting problems!

What other techniques could there be with Arrays, you might be wondering? Well, wonder no more. Here is a quick taster!

A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected where expected[i] is the expected height of the ith student in line.

Given a binary array nums, return the maximum number of consecutive 1's in the array if you can flip at most one 0.

Given integer array nums, return the third maximum number in this array. If the third maximum does not exist, return the maximum number.

Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.

Given an array of integers nums, calculate the pivot index of this array.

Determine whether the largest element in the array is at least twice as much as every other number in the array. If it is, return the index of the largest element, or return -1 otherwise.

Given a non-empty array of decimal digits representing a non-negative integer, increment one to the integer.

Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum.

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.

Given an array of positive integers nums and a positive integer target, return the minimal length of a contiguous subarray [numsl, numsl+1, ..., numsr-1, numsr] of which the sum is greater than or equal to target. If there is no such subarray, return 0 instead.

Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle.