DEV Community

Mukilan Palanichamy
Mukilan Palanichamy

Posted on

My journey in competitive programming

Anagram Check and Cookies Problem for today.

Hello, guys

I have had a sort of scattered day today. Kind of feel not-so-productive because of holiday lag, but I have been able to complete my task of the day. Being a new learner in Python using linked lists, I had really loved picking up all new concepts today. This is what I did:

Anagram:

To start with, I undertook an easy problem — checking to see if a given array is an anagram. A good example of an anagram is when two arrays, or strings, have identical elements, but in reverse order. I compared the elements of both arrays and checked if these were identical in terms of frequency and content. This proved to be a good, straightforward sort of problem.

Image description

Cookies Problem:
The next problem I had was the "cookies problem." I'd say this is a greedy algorithm problem, wherein cookies are distributed to children depending on their greed factor and the size of the cookies. The objective is to satisfy as many children as possible by giving them the biggest cookie they can handle according to their greed. It took me a pretty long time to comprehend and solve, but this was really an interesting challenge. Overall, I'm happy with how the day turned out, and it ended perfectly as I look forward to a great weekend ahead!

Image description

Thanks!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay