Skip to content

Instantly share code, notes, and snippets.

Avatar

Vedant Bhatt vedantb

View GitHub Profile
View perfectSquare.js
/**
* @param {number} num
* @return {boolean}
*/
var isPerfectSquare = function(num) {
if (num < 2) return true;
let left = 2;
let right = Math.floor(num / 2);
View MajorityElement.js
/**
* @param {number[]} nums
* @return {number}
*/
var majorityElement = function(nums) {
let count = 0;
let candidate;
nums.forEach((num) => {
if(count === 0) candidate = num;
View keybase.md

Keybase proof

I hereby claim:

  • I am vedantb on github.
  • I am vedantb (https://keybase.io/vedantb) on keybase.
  • I have a public key ASCwd1LJDKfCJaU4n7I8wHw2bKdNBWlMZ9PDdCavrQPG-Ao

To claim this, I am signing this object:

You can’t perform that action at this time.