Skip to content
View flyptkarsh's full-sized avatar
Block or Report

Block or report flyptkarsh

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned

  1. Cracking-The-Coding-Interview-Ruby-Solutions Cracking-The-Coding-Interview-Ruby-Solutions Public

    Cracking The Coding Interview Ruby Solutions

    Ruby 24 10

  2. Cracking-The-Coding-Interview-JS-Solutions Cracking-The-Coding-Interview-JS-Solutions Public

    Cracking The Coding Interview JS Solutions

    JavaScript 2

  3. Kadane's Algorithm Kadane's Algorithm
    1
    function kadanesAlgorithm(array) {
    2
      let maxEndingHere = maxSoFar = array[0];
    3
    
                  
    4
      for (let i = 1; i < array.length; i++) {
    5
        maxEndingHere = Math.max(array[i], maxEndingHere + array[i]);
  4. Merging Sorted Arrays In-Place Merging Sorted Arrays In-Place
    1
    function merge(nums1, m, nums2, n) {
    2
      let p = m + n - 1;
    3
      let p1 = m - 1;
    4
      let p2 = n - 1;
    5
    
                  
  5. Merging Sorted Arrays Naive Merging Sorted Arrays Naive
    1
    def merge_and_sort(nums1, m, nums2, n)
    2
      # Fill the rest of nums1 with elements from nums2
    3
      nums1[m...m+n] = nums2[0...n]
    4
      # Sort nums1 in place
    5
      nums1.sort!
  6. Kadane's Algorithm Kadane's Algorithm
    1
    def kadanes_algorithm(array)
    2
      max_ending_here = max_so_far = array[0]
    3
    
                  
    4
      array[1..-1].each do |num|
    5
        max_ending_here = [num, max_ending_here + num].max