TechieGanesh
TechieGanesh
  • 24
  • 4 695
Leetcode 1315 : Sum of Nodes with Even-Valued Grandparent | Salesforce (Medium)
Given the root of a binary tree, return the sum of values of nodes with an even-valued grandparent. If there are no nodes with an even-valued grandparent, return 0.
A grandparent of a node is the parent of its parent if it exists.
Problem link : leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent/
Interview link: leetcode.com/discuss/interview-question/5526715/Salesforce-Interview-Experience-or-MTS-or-12th-July
#leetcode #salesforce #coding #array #recursion #java #javaprogramming #salesforce #leetcode #codemodecode #programming #codinginterview #placement #techieganesh #techieganeshofficial #tgo
มุมมอง: 40

วีดีโอ

Leetcode 416 : Partition Equal Subset Sum | Salesforce OA (Medium)
มุมมอง 35หลายเดือนก่อน
Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise. Problem link : leetcode.com/problems/partition-equal-subset-sum/ Interview link: leetcode.com/discuss/interview-question/5780798/Salesforce-Online-Assessment-Hackerrank-sept-2024 #leetcode #salesforce #coding #array #dynamicprogr...
Find the no of stable sub segments. | Part 2 (Salesforce)
มุมมอง 5023 หลายเดือนก่อน
Find the no of stable sub segments. Problem link : leetcode.com/discuss/interview-question/5465365/Salesforce-:-General-Software-Engineer-Assessment-(INDIA-ONLY) Part 1: th-cam.com/video/mCere30LeR8/w-d-xo.html #leetcode #coding #array #dynamicprogramming #java #javaprogramming #salesforce #leetcode #codemodecode #programming #codinginterview #placement #techieganesh #techieganeshofficial #tgo
Find the no of stable sub segments. (Salesforce)
มุมมอง 6703 หลายเดือนก่อน
Find the no of stable sub segments. Problem link : leetcode.com/discuss/interview-question/5465365/Salesforce-:-General-Software-Engineer-Assessment-(INDIA-ONLY) #leetcode #coding #array #dynamicprogramming #java #javaprogramming #salesforce #leetcode #codemodecode #programming #codinginterview #placement #techieganesh #techieganeshofficial #tgo
Leetcode 3196: Maximize Total Cost of Alternating Subarrays (Medium)
มุมมอง 103 หลายเดือนก่อน
You are given an integer array nums with length n. The cost of a subarray nums(l..r), is defined as: cost(l, r) = nums(l) - nums(l 1) ... nums(r) * (−1)r − l Your task is to split nums into subarrays such that the total cost of the subarrays is maximized, ensuring each element belongs to exactly one subarray. Formally, if nums is split into k subarrays, where k greater than 1, at indices i1, i2...
Leetcode 3075: Maximize Happiness of Selected Children (Medium)
มุมมอง 507 หลายเดือนก่อน
You are given an array happiness of length n, and a positive integer k. There are n children standing in a queue, where the ith child has happiness value happiness[i]. You want to select k children from these n children in k turns. In each turn, when you select a child, the happiness value of all the children that have not been selected till now decreases by 1. Note that the happiness value can...
Leetcode 1011: Capacity To Ship Packages Within D Days (Medium)
มุมมอง 237 หลายเดือนก่อน
A conveyor belt has packages that must be shipped from one port to another within days days. The ith package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship. Return the least weight capacity of the ship that will result in all t...
Leetcode 2861 : Split the Array (Easy)
มุมมอง 287 หลายเดือนก่อน
You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that: a) nums1.length nums2.length nums.length / 2. b) nums1 should contain distinct elements. c) nums2 should also contain distinct elements. Return true if it is possible to split the array, and false otherwise. #leetcode #coding #array #binarysearch #java #javaprogramming #leet...
Leetcode 2861 : Maximum Number of Alloys (Medium)
มุมมอง 71ปีที่แล้ว
You are the owner of a company that creates alloys using various types of metals. There are n different types of metals available, and you have access to k machines that can be used to create alloys. Each machine requires a specific amount of each metal type to create an alloy. For the ith machine to create an alloy, it needs composition[i][j] units of metal of type j. Initially, you have stock...
Leetcode 2841 : Maximum Sum of Almost Unique Subarray (Medium)
มุมมอง 47ปีที่แล้ว
You are given an integer array nums and two positive integers m and k. Return the maximum sum out of all almost unique subarrays of length k of nums. If no such subarray exists, return 0. A subarray of nums is almost unique if it contains at least m distinct elements. A subarray is a contiguous non-empty sequence of elements within an array. #leetcode #coding #slidingwindow #prefixsum #two_poin...
Leetcode 2575 : Find the Divisibility Array of a String (Medium)
มุมมอง 8ปีที่แล้ว
You are given a 0-indexed string word of length n consisting of digits, and a positive integer m. The divisibility array div of word is an integer array of length n such that: a) div[i] = 1 if the numeric value of word[0,...,i] is divisible by m, or b) div[i] = 0 otherwise. Return the divisibility array of word. #leetcode #coding #prefixsum #dynamicprogramming #greedyalgorithm #string #strings ...
Leetcode 167 : Two Sum II - Input Array Is Sorted (Medium)
มุมมอง 15ปีที่แล้ว
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2]. Return the indices of the two numbers, index1 and index2, added by one as an integer array [index1, index2] of length 2. The tests are generated such that there is exactly one...
Leetcode 2840 : Check if Strings Can be Made Equal With Operations II (Medium)
มุมมอง 70ปีที่แล้ว
You are given two strings s1 and s2, both of length n, consisting of lowercase English letters. You can apply the following operation on any of the two strings any number of times: * Choose any two indices i and j such that i less than j and the difference j - i is even, then swap the two characters at those indices in the string. Return true if you can make the strings s1 and s2 equal, and fal...
Leetcode 2772 : Apply Operations to Make All Array Elements Equal to Zero (Medium)
มุมมอง 282ปีที่แล้ว
You are given a 0-indexed integer array nums and a positive integer k. You can apply the following operation on the array any number of times: 1) Choose any subarray of size k from the array and decrease all its elements by 1. Return true if you can make all the array elements equal to 0, or false otherwise. #leetcode #coding #array #leetcode_medium #codemodecode #programming #codinginterview #...
Leetcode 2789 : Largest Element in an Array after Merge Operations (Medium)
มุมมอง 21ปีที่แล้ว
You are given a 0-indexed array nums consisting of positive integers. You can do the following operation on the array any number of times: * Choose an ith index and ith value less than equal to i 1 th value. Replace the element i 1 th with ith value i 1 th value and delete the element ith from the array. Return the value of the largest element that you can possibly obtain in the final array. #l...
Leetcode 2799 : Count Complete Subarrays in an Array (Medium) | Approach 1
มุมมอง 38ปีที่แล้ว
Leetcode 2799 : Count Complete Subarrays in an Array (Medium) | Approach 1
Leetcode 2811 : Check if it is Possible to Split Array (Medium) | Approach 1
มุมมอง 8ปีที่แล้ว
Leetcode 2811 : Check if it is Possible to Split Array (Medium) | Approach 1
Leetcode 2817 : Minimum Absolute Difference Between Elements With Constraint (Medium)
มุมมอง 44ปีที่แล้ว
Leetcode 2817 : Minimum Absolute Difference Between Elements With Constraint (Medium)
Leetcode 2828 :Check if a String Is an Acronym of Words (Easy) | StringBuilder vs String Performance
มุมมอง 95ปีที่แล้ว
Leetcode 2828 :Check if a String Is an Acronym of Words (Easy) | StringBuilder vs String Performance
Leetcode 1962 : Remove Stones to Minimize the Total (Medium)
มุมมอง 26ปีที่แล้ว
Leetcode 1962 : Remove Stones to Minimize the Total (Medium)
Leetcode 2542 : Maximum Subsequence Score (Medium)
มุมมอง 649ปีที่แล้ว
Leetcode 2542 : Maximum Subsequence Score (Medium)
Leetcode 2342 : Max Sum of a Pair With Equal Sum of Digits (Medium)
มุมมอง 112ปีที่แล้ว
Leetcode 2342 : Max Sum of a Pair With Equal Sum of Digits (Medium)
Leetcode 1405 : Longest Happy String (Medium)
มุมมอง 1.7Kปีที่แล้ว
Leetcode 1405 : Longest Happy String (Medium)
Leetcode 1753 : Maximum Score From Removing Stones (Medium)
มุมมอง 112ปีที่แล้ว
Leetcode 1753 : Maximum Score From Removing Stones (Medium)