Skip to content
View matharoo's full-sized avatar

Block or report matharoo

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 Loading

  1. In an array of ints, return the inde... In an array of ints, return the index such that the sum of the elements to the right of that index equals the sum of the elements to the left of that index
    1
    function peak(arr) {
    2
        let leftsum = 0;
    3
        let rightsum = 0;
    4
        mid = Math.floor(arr.length / 2)
    5
        const hash = {}
  2. A function that accepts a 2D array r... A function that accepts a 2D array representing a Sudoku board, and returns true if it is a valid solution, or false otherwise. The cells of the sudoku board may also contain 0's, which will represent empty cells. Boards containing one or more zeroes are considered to be invalid solutions.
    1
    function validSolution(board) {
    2
    	let valid = true;
    3
    	const testvaliditiy = (arr) => {
    4
    		let set = new Set(arr);
    5
    		if (arr.includes(0) || [...set].length !== 9) {
  3. Priority Queue implementation in Jav... Priority Queue implementation in Javascript
    1
    /**
    2
     * A priority queue stores a list of items but each can have a numeric priority value.
    3
     * Items with a higher priority are dequeued before items with a lower priority.
    4
     * Implemented as a hash of arrays where the hash keys are priority values.
    5
     */
  4. Using async/await in javascript, tra... Using async/await in javascript, transforming promise to chain to async/await
    1
    function callApi(url){
    2
      return new Promise((resolve,reject) => {
    3
        console.log(`calling API: ${url}`)
    4
        if(url==='twitter'|| url=='facebook'){
    5
          resolve(`connected to ${url}`)