726. Number of Atoms | Stacks | Leetcode Daily Challlenge | DSA | Hindi
HTML-код
- Опубликовано: 22 авг 2024
- Problem Name:
726. Number of Atoms
Problem Statement:
Given a string formula representing a chemical formula, return the count of each atom.
The atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name.
One or more digits representing that element's count may follow if the count is greater than 1. If the count is 1, no digits will follow.
For example, "H2O" and "H2O2" are possible, but "H1O2" is impossible.
Two formulas are concatenated together to produce another formula.
For example, "H2O2He3Mg4" is also a formula.
A formula placed in parentheses, and a count (optionally added) is also a formula.
For example, "(H2O2)" and "(H2O2)3" are formulas.
Return the count of all elements as a string in the following form: the first name (in sorted order), followed by its count (if that count is more than 1), followed by the second name (in sorted order), followed by its count (if that count is more than 1), and so on.
The test cases are generated so that all the values in the output fit in a 32-bit integer.
Problem Link:
leetcode.com/p...
Solution link:
github.com/Tiw...
Graph Playlist:
• Graph Data Structure S...
Java Plus DSA Placement Course Playlist:
• Java and DSA Course Pl...
Java Plus DSA Sheet:
docs.google.co...
Notes:
github.com/Tiw...
Telegram Link:
shashwattiwari...
Ultimate Recursion Series Playlist:
• Recursion and Backtrac...
Instagram Handle: (@shashwat_tiwari_st)
shashwattiwari...
Samsung Interview Experience:
• I cracked Samsung | SR...
Company Tags:
Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe | Samsung
Timestamp:
0:00 - Introduction
#ShashwatTiwari #coding #problemsolving
Please do like, if you understood 😊. Like target for this video is 90
Respect for all those who came here after seeing the chemistry in a leet code question! Only Shashwat bhai can save us!
Thanks 😊
love from spain♥
Whaa ka newspaper sach me cloth pe print hote hai ya rumour hai .
Thank you for explaining, i actually code in c++, i came here know the concept & implementation... and you save me♥♥
very nice explanantion sir,Thankyou
Sir wo remove substring "ab" and "ba" to get max point question ke video pe doubt comment Kiya haii.. Please sir solve krdo
okay mai debug krke btata hu
@@shashwat_tiwari_st Yes sir plz batao
@@tejas2636 I have replied, you can check.
Great
thank you sir.
❤❤❤
Sir what is the space complexity?
@@arneshbasak1910 stack of map. N^2
What is the TC
shayad o(n)
hi, TC will be O(N^2). N for string iteration and N for iterating the map.