Piyush Acharya·Jun 14, 2023Fastest JS Solution — Beats 75% of Solutions with 50 MS RuntimeThe code snippet is a JavaScript function that takes an array and a function as input and returns a new array with the function applied to…
Piyush Acharya·Jun 14, 2023JAVASCRIPT SOLUTION BEATS 83% IN MEMORY USAGEThe code snippet is a JavaScript implementation of the reduce() method for arrays. The reduce() method is used to apply a function to each…
Piyush Acharya·Jun 14, 20232396. LeetCode’s Strictly Palindromic Number — FASTEST JAVA SOLUTION — 0 MS RUNTIME ⏩⏩The code seems to be checking if a given number is strictly palindromic in all bases from 2 to n-2.
Piyush Acharya·Jun 11, 20232733. LeetCode’s Neither Minimum nor Maximum — JAVA SOLUTION BEATS 100% OF SOLUTIONS IN BOTH…# Code ``` class Solution { public int findNonMinOrMax(int[] nums) { int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; for…
Piyush Acharya·Jun 5, 20232716. LeetCode’s Minimize String Length — FASTEST JAVA SOLUTION BEATS 100% OF SOLUTIONS!!!!Intuition
Piyush Acharya·Jun 5, 20232011. LeetCode’s Final Value of Variable After Performing Operations — SIMPLE & EFFICIENT Java…Intuition
Piyush Acharya·Jun 2, 20232703. LeetCode’s Return Length of Arguments Passed — Extremely LOGICAL JS Solution Beats 83% in…Intuition
Piyush Acharya·Jun 2, 2023771. LeetCode’s Jewels and Stones — Super SIMPLE & EFFICIENT Algorithm Beats 92% in RuntimeIntuition
Piyush Acharya·Jun 2, 20238. LeetCode’s String to Integer (atoi) — Extremely SIMPLE & LOGICAL Java SOLUTION — Beats 94% of…Intuition