Here I am uploading files whenever I solved any algorithms:
- How to draw login, Implementation and perfection
- How to treat with arrays
- How to count maximum times repeated element
- How to find minimum times repeated element
- How to find highest & lowest value element
This problem got my almost whole day. In this I did :
- How to use arrays
- How to handle with years ,days, and months
- How to set up logic, this is main thing I learnt from this
Problem Statement: There is a large pile of socks that must be paired by color. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. But, I got stuck on this problem for more than 1 hour , just crazed in the complex logic I designed
In this problem I used arrays!!
- First I find element if it repeats twice than increment the count
- Next I removed that element from the array so that if third element of same type appears it will have to be count
- Thus if element exists thrice or more, it will be considered by removing the previous same elements from array
Problem Statement: 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.
Here I used arrays also this task was very easy for me
This problem got my a lot of time , it was very difficult to build my logic for this, but I solved.
I learnt:
Declaring, initializing, modifying variable values using arithmetic operations Where to use break statements Conditional Statements Managing program flow using control flow statements (break) to exit loops. Performing basic mathematical operations (% for modulus) How to use Comparison Operators cmath library
I just design a logic for this problem, the problem needs a lot of attention and I gave my full and finally succeeded in doing it completely. It demands alot about mind focusing situation.