vishalmx3

vishal.codes

Posted on May 10, 2024

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

šŸ’– šŸ’Ŗ šŸ™… šŸš©
vishalmx3
vishal.codes

Posted on May 10, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Day 42/366
1percentplusplus Day 42/366

May 12, 2024

Day 41/366
1percentplusplus Day 41/366

May 11, 2024

Day 40/366
1percentplusplus Day 40/366

May 10, 2024

Day 39/366
1percentplusplus Day 39/366

May 9, 2024

Day 38/366
1percentplusplus Day 38/366

May 8, 2024