Programming Chaska
82 FOLLOWERS
This is a blog on Programming languages where you can get unique and different JAVA, C, and C++ programs logic and technique to apply the algorithm in programming. Here I am sharing my JAVA project and you can get programs with explanations and learn basic syntax, coding and programming.
Programming Chaska
3d ago
26. Remove Duplicates from Sorted Array - LeetCode - Medium
Solve this problem in LeetCode
Problem Description:
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the number of unique elements in nums.
Consider the number of unique elements of nums to be k, to get accepted, you need to do the following things:
Change the array nums such that the first k elements of nums contain the unique elements in the ..read more
Programming Chaska
3d ago
128. Longest Consecutive Sequence - LeetCode - Medium
Solve this problem in LeetCode
Problem Description:
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.
You must write an algorithm that runs in O(n) time.
Example 1:
Input: nums = [100,4,200,1,3,2]
Output: 4
Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4.
Example 2:
Input: nums = [0,3,7,2,5,8,4,6,0,1]
Output: 9
Constraints:
0 <= nums.length <= 10^5
-10^9 <= nums[i] <= 10^9
Approach:
In ..read more
Programming Chaska
3d ago
242. Valid Anagram - LeetCode - Easy
Solve this problem in LeetCode
Problem Description:
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
Constraints:
1 <= s.length, t.length <= 5 * 10^4
s and t consist of lowercase English letters.
Approach:
Two words ..read more
Programming Chaska
3d ago
217. Contains Duplicate - LeetCode - Easy
Solve this problem in LeetCode
Problem Description:
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
Example 1:
Input: nums = [1,2,3,1]
Output: true
Example 2:
Input: nums = [1,2,3,4]
Output: false
Example 3:
Input: nums = [1,1,1,3,3,4,3,2,4,2]
Output: true
Constraints:
1 <= nums.length <= 10^5
-10^9 <= nums[i] <= 10^9
Approach:
The problem becomes easy if you use Set Data Structure. Set has inbuilt methods for checkin ..read more
Programming Chaska
5d ago
3. Longest Substring Without Repeating Characters - LeetCode - Medium
Problem Description:
Given a string s, find the length of the longest substring without repeating characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
Example 3:
Input: s = "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3.
Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
Constr ..read more
Programming Chaska
6d ago
2. Add Two Numbers - LeetCode - Medium
Problem Description:
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itself.
Example 1:
Input: l1 = [2,4,3], l2 = [5,6,4]
Output: [7,0,8]
Explanation: 342 + 465 = 807.
Example 2:
Input: l1 = [0], l2 = [0]
Output: [0]
Example 3:
Input: l1 = [9,9,9,9,9,9 ..read more
Programming Chaska
8M ago
Accenture Interview Experience:
In this post, I am sharing my personal Accenture interview experience which I got through an off-campus Accenture drive for ASE in July 2023. ASE stands for Associate Software Engineer, which offers a 4.5 LPA salary in 2023. Let's take a look at the eligibility criteria, Selection Process, and my experience.
Eligibility Criteria :
All streams/branches of B.E/B.Tech/M.E/M.Tech, MCA, and M.Sc. (CSE, IT only) from 2022 & 2023 years of pass outs with full-time education only (Part-time and distance educations are not considered)
&nbs ..read more
Programming Chaska
9M ago
Hexaware Interview Experience:
In this post, I am sharing my personal Hexaware interview experience which I got through PGET Program in 2022. PGET stands for Premier Graduate Engineer Trainee, which offers 6 LPA salary in 2022. There is another GET program which stands for Graduate Engineer Trainee that offers 4 LPA. My college was eligible for PGET Program. Let's take a look at the eligibility criteria, Selection Process, and my experience.
Eligibility Criteria :
1. 60 % throughout (10th to highest Degree).
2. Branches eligible: CS, IT, EC, EE & EX ..read more
Programming Chaska
10M ago
Cisco Interview Experience:
In this post, I am sharing my personal Cisco interview experience which I got through Cisco Ideathon 2022. The program is a great opportunity for students with potential and creativity to be a part of Cisco’s technological innovation. The qualifiers of the Cisco Ideathon are awarded an internship opportunity followed by full-time placement within Cisco. Let's take a look at the eligibility criteria, Selection Process, and my experience.
Eligibility Criteria :
1. 7.0 CGPA in B.Tech. till the current semester. No criteria for 10th and 12th
2.  ..read more
Programming Chaska
2y ago
Expected move:
Problem Description:
You are given a fair coin and two integers X and N.
You repeatedly flip the coin and perform the following operation based on the result:
· If it lands on heads, then X will increase by 1. However, if X=N then X will not change.
· If it lands on tails, X will decrease by 1.
You stop as soon as the value of X becomes 1.
Find the expected number of coin flips.
Note that it is ..read more