Abhishek Sharma

Started my Data Science journey in my 2nd year of college and since then continuously into it because of the magical powers of ML and continuously doing projects in almost every domain of AI like MNL, DL, CV, NLP.

Machine Learning Projects

[Solved] Given an integer array nums, move all 0’s to the end of it while maintaining the relative order of the non-zero elements.

Question Given an integer array nums, move all 0‘s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0] Example 2: Input: nums = [0] Output: [0] Constraints: 1 <= nums.length <= …

[Solved] Given an integer array nums, move all 0’s to the end of it while maintaining the relative order of the non-zero elements. Read More »

Machine Learning Projects

[Solved] You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.

Question You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, …, n] and you want …

[Solved] You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Read More »

Machine Learning Projects

[Solved] Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.

Question Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Example 1: Input: nums = [3,0,1] Output: 2 Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since …

[Solved] Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Read More »

Machine Learning Projects

[Solved] Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.

Question Given an integer num, repeatedly add all its digits until the result has only one digit, and return it. Example 1: Input: num = 38 Output: 2 Explanation: The process is 38 –> 3 + 8 –> 11 11 –> 1 + 1 –> 2 Since 2 has only one digit, return it. Example 2: …

[Solved] Given an integer num, repeatedly add all its digits until the result has only one digit, and return it. Read More »

Machine Learning Projects

[Solved] Given the root of a binary tree, return all root-to-leaf paths in any order.

Question Given the root of a binary tree, return all root-to-leaf paths in any order. A leaf is a node with no children. Example 1: Input: root = [1,2,3,null,5] Output: [“1->2->5″,”1->3”] Example 2: Input: root = [1] Output: [“1”] Constraints: The number of nodes in the tree is in the range [1, 100]. -100 <= Node.val <= 100 Python Solution

Machine Learning Projects

[Solved] Given two strings s and t, return true if t is an anagram of s, and false otherwise.

Question Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input: s = “anagram”, t = “nagaram” Output: true Example 2: Input: s = “rat”, t = “car” Output: false …

[Solved] Given two strings s and t, return true if t is an anagram of s, and false otherwise. Read More »

Machine Learning Projects

[Solved] You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

Question You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window. Example 1: Input: nums = …

[Solved] You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Read More »

Machine Learning Projects

[Solved] Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

Question Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer. You must write an algorithm that runs in O(n) time and without using the division operation. Example 1: Input: nums = [1,2,3,4] Output: [24,12,8,6] Example 2: Input: nums = …

[Solved] Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. Read More »

Machine Learning Projects

[Solved] There is a singly-linked list head and we want to delete a node node in it. You are given the node to be deleted node. You will not be given access to the first node of head.

Question There is a singly-linked list head and we want to delete a node node in it. You are given the node to be deleted node. You will not be given access to the first node of head. All the values of the linked list are unique, and it is guaranteed that the given node node is not the last node in the linked list. Delete …

[Solved] There is a singly-linked list head and we want to delete a node node in it. You are given the node to be deleted node. You will not be given access to the first node of head. Read More »

Machine Learning Projects

[Solved] Given the head of a singly linked list, return true if it is a palindrome or false otherwise.

Question Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Example 1: Input: head = [1,2,2,1] Output: true Example 2: Input: head = [1,2] Output: false Constraints: The number of nodes in the list is in the range [1, 105]. 0 <= Node.val <= 9 Follow up: Could you do it in O(n) time and O(1) space? Python …

[Solved] Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Read More »