Creating a Repo for Continuous practice towards Python Exercises and ML Exercises once a week.
- 6 days awesome Python Practice on random logical questions and,
- 7th Day one ML Use case which can be carries over if needed.
- Based on my availability and some spare time, will be adding some bonus questions/topics. For example, Sorting in Python/Linked List concept in Python, etc.
Star it/ Fork it and contribute with questions.
For any query/issues, you are welcome to open an issue.
Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.
Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contain any char.
POSITIVE or NEGATIVE ? If the blood composition of the person is a subsequence of the virus composition V, then the person is identified as POSITIVE otherwise NEGATIVE.
Given a right angled triangle ABC, right angled at B. Find angle ABD, where D is the mid-point of the hypotenuse(side AC).
Given a list of integers prices representing prices of cars for sale, and a budget k, return the maximum number of cars you can buy.
A newly opened multinational brand has decided to base their company logo on the three most common characters in the company name. They are now trying out various combinations of company names and logos based on this condition. Given a string, which is the company name in lowercase letters, your task is to find the top three most common characters in the string.
ML Challenge:
- Stock Price Prediction
- Future Predictions
- Final Results
Longest Consecutive Duplicate String -> Given a lowercase alphabet string s, return the length of the longest substring with same characters.
Palindromic Integer
UGLY NUMBER -> Given an integer n, return whether its prime factors only include 2, 3 or 5.
No Idea! -> There is an array of n integers. There are also 2 disjoint sets,A and B, each containing integers. You like all the integers in set A and dislike all the integers in set B. Your initial happiness is 0. For each i integer in the array, if ,i belongs A you add 1 to your happiness. If i belongs to B, you add -1 to your happiness. Otherwise, your happiness does not change. Output your final happiness at the end.
SUBARRAY DIVISION -> Two children, Lily and Ron, want to share a chocolate bar. Each of the squares has an integer on it. Lily decides to share a contiguous segment of the bar selected such that:
The length of the segment matches Ron's birth month, and,
The sum of the integers on the squares is equal to his birth day.
Determine how many ways she can divide the chocolate.
BILL DIVISION -> Two friends Anna and Brian, are deciding how to split the bill at a dinner. Each will only pay for the items they consume. Brian gets the check and calculates Anna's portion. You must determine if his calculation is correct.
For example, assume the bill has the following prices: bill = [2,4,6]. Anna declines to eat item k = bill[2] which costs 6. If Brian calculates the bill correctly, Anna will pay (2+4)/2=3. If he includes the cost of bill[2], he will calculate (2+4+2)/2=6. In the second case, he should refund to 3 Anna.
Electronics Shop -> A person wants to determine the most expensive computer keyboard and USB drive that can be purchased with a give budget. Given price lists for keyboards and USB drives and a budget, find the cost to buy them. If it is not possible to buy both items, return -1.
Designer PDF Viewer -> When a contiguous block of text is selected in a PDF viewer, the selection is highlighted with a blue rectangle. In this PDF viewer, each word is highlighted independently.
Save the Prisoner! -> A jail has a number of prisoners and a number of treats to pass out to them. Their jailer decides the fairest way to divide the treats is to seat the prisoners around a circular table in sequentially numbered chairs. A chair number will be drawn from a hat. Beginning with the prisoner in that chair, one candy will be handed to each prisoner sequentially around the table until all have been distributed.
Remove all consecutive duplicates from the string
Drawing Book -> A teacher asks the class to open their books to a page number. A student can either start turning pages from the front of the book or from the back of the book. They always turn pages one at a time. When they open the book, page 1 is always on the right side. Given n and p, find and print the minimum number of pages that must be turned in order to arrive at page p.
The Stolen Breakfast Drone -> Given the list of IDs, which contains many duplicate integers and one unique integer, find the unique integer.
Beautiful Days at the Movies -> Given a range of numbered days [i.....j], and a number k, determine the number of days in the range that are beautiful. Beautiful numbers are defined as numbers where |i - reverse(i)| is evenly divisible by k. If a day's value is a beautiful number, it is a beautiful day. Return the number of beautiful days in the range.
Picking Numbers -> Given an array of integers, find the longest subarray where the absolute difference between any two elements is less than or equal to 1.
Climbing the Leaderboard
Utopian Tree -> The Utopian Tree goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter. A Utopian Tree sapling with a height of 1 meter is planted at the onset of spring. How tall will the tree be after n growth cycles?
Viral Advertising -> HackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly 5 people on social media.
- On the first day, half of those 5 people (i.e., floor(5/2) = 2 ) like the advertisement and each shares it with 3 of their friends. At the beginning of the second day,floor(5/2)3 = 6 people receive the advertisement.
- Each day, floor(reciepents/2) of the recipients like the advertisement and will share it with 3 friends on the following day.
Assuming nobody receives the advertisement twice, determine how many people have liked the ad by the end of a given day, beginning with launch day as day 1.
Circular Array Rotation
BINARY GAP -> Find the longest subsequence of zeros in binary respresentation of an integer.
CyclicRotation -> Rotate an array to the right by a given number of steps.
PermMissingElem -> Find the missing element in a given permutation.
TapeEquilibrium
FrogRiverOne -> A small frog wants to get to the other side of a river. The frog is initially located on one bank of the river (position 0) and wants to get to the opposite bank (position X+1). Leaves fall from a tree onto the surface of the river.
PermCheck
CountDiv
Passing Cars -> Counting the number of PAIRS based on EAST/WEST cars directions
Finding Digits -> Given an integer, for each digit that makes up the integer determine whether it is a divisor. Count the number of divisors occurring within the integer.
Extra Long Factorials -> Calculate and print the factorial of a given integer.
Append and Delete
Min Avg Two Slice -> https://app.codility.com/programmers/lessons/5-prefix_sums/min_avg_two_slice/
MaxProductOfThree -> A non-empty array A consisting of N integers is given. The product of triplet (P, Q, R) equates to A[P] x A[Q] x A[R] (0 ≤ P < Q < R < N).
TRIANGLE
Brackets
Nested Brackets
Fish Survival -> https://app.codility.com/programmers/lessons/7-stacks_and_queues/fish/
Stone Wall -> https://app.codility.com/programmers/lessons/7-stacks_and_queues/stone_wall/
Coming Soon
Demonstrating Multi-processing in Python
Coming Soon
Coming Soon
Coming Soon
Coming Soon