DEV Community

vishal.codes
vishal.codes

Posted on

1 1 1 1 1

Day 40/366

πŸš€ Today's Learning:

🌟 DSA

  • Remove outermost parenthesis
  • Palindrome check

🌟 Dev

  • Asynchronous behaviour of NodeJS

πŸ” Some Key Highlights:

DSA

In the "Remove outermost parenthesis" code, we iterate through each character of the input string, keeping track of the count of open and close parentheses. We only add characters to the result string if they are not the outermost parentheses. The outermost parentheses are identified by the count of open and close parentheses being equal and the count being zero at the end.

For the "Palindrome check" code, we compare characters from the beginning and end of the input string simultaneously, moving inward until we reach the middle. If at any point the characters don't match, we conclude that the string is not a palindrome. If all characters match, the string is a palindrome.

DEV

In Node.js, asynchronous behavior allows tasks to be executed concurrently without waiting for previous tasks to complete. This is achieved using non-blocking I/O operations and event-driven architecture. When a task requiring I/O operation is encountered, Node.js delegates it to the system, and meanwhile, continues executing other tasks. Once the I/O operation is completed, a callback function is triggered to handle the result. This asynchronous model ensures efficient utilization of system resources and enables Node.js to handle large numbers of concurrent connections effectively.

#100daysofcode #dsa #coding

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

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

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

Okay