teleren/devto huggingface dataset:
"What's there for students at GitHub?" you ask, well...
Tags: github, offers, beginners
Published: 2022-07-21 14:54:51

**GitHub Student Developer Pack is a must to have if you want to access professional tools at no cost.**
[Get it here](https://education.github.com/pack)

All you need is a email from your educational institution,and a proof that you are enrolled at that place(like fee receipt,ID card or any document with your Name,Name of Institution,and Date with current year[not sure about this one])

For me the best one in this offer is [Azure services](https://azure.microsoft.com) which offers a Private Server  and [FrontendMasters](https://frontendmasters.com) for learning Nodejs stuff, and Domains like [Namecheap](https://www.namecheap.com)(you'll get a `.me` domain)

If you are a student and want to try your hand at learning real work,this is a goto thing for you

All it has is :
_Canva,
Namecheap,
Microsoft Azure,
JetBrains,
Educative,
Name.com,
DigitalOcean,
Visual Studio Code,
Bootstrap Studio,
GitHub Pages,
Microsoft Visual Studio Dev Essentials,
GitHub,
FrontendMasters,
DataCamp,
.TECH,GitLens,
OneMonth,
PomoDone,
Polypane,
Termius,
Iconscout,
DeepSource,
Doppler,
Testmail,
MongoDB,
InterviewCake,
StreamYard,
Github Campus Experts,
GitKraken,
Covalence,
Icons8,
Netwise,
Twilio,
Typeform,
Atom,
Mailgun,
GoRails,
New Relic,
Replit,
Pageclip,
Stripe,
Thinkful,
HazeOver,
Arduino,
Datadog,
Imgbot,
GitHub Desktop,
BrowserStack,
Kodika,
PopSQL,
Sentry,
WorkingCopy,
Tower,
Blackfire,
Xojo,
Adafruit,
Dashlane,
Gitpod,
Freshpaint,
Themeisle,
Travis CI,
Zyte,
BetterCodeHub,
Kaltura,
Blockchair,
DailyBot,
LambdaTest,
Cryptolens,
CodeScene,
Restyled,
SymfonyCasts,
AstraSecurity,
SimpleAnalytics,
Lingohub,
Honeybadger,
Vaadin,
SQLGate,
DeepScan,
POEditor,
CARTO,
ConfigCat,
AccessLint,
Appfigures,
Baremetrics_

enjoy :)
2022. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:53:44

```
class Solution {
 public:
  vector<vector<int>> construct2DArray(vector<int>& original, int m, int n) {
    if (original.size() != m * n)
      return {};

    vector<vector<int>> ans(m, vector<int>(n));

    for (int i = 0; i < original.size(); ++i)
      ans[i / n][i % n] = original[i];

    return ans;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/convert-1d-array-into-2d-array/
1935. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:52:49

```
class Solution {
 public:
  int canBeTypedWords(string text, string brokenLetters) {
    int ans = 0;
    istringstream iss(text);
    vector<bool> broken(26);

    for (const char c : brokenLetters)
      broken[c - 'a'] = true;

    for (string word; iss >> word;)
      ans += canBeTyped(word, broken);

    return ans;
  }

 private:
  bool canBeTyped(const string& word, const vector<bool>& broken) {
    for (const char c : word)
      if (broken[c - 'a'])
        return false;
    return true;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/maximum-number-of-words-you-can-type/
1832. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:51:55

```
class Solution {
public:
    bool checkIfPangram(string sentence) {
        set<char> letters;
        for (char ch : sentence) {
            letters.insert(ch);
        }
        return letters.size() == 26;
    }
};
```


#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/check-if-the-sentence-is-pangram/
1736. Leetcode Solution in Java
Tags: java
Published: 2022-07-21 14:50:29

```
class Solution {
    public String maximumTime(String time) {
        char[] array = time.toCharArray();
        if (array[0] == '?') {
            if (array[1] == '?') {
                array[0] = '2';
                array[1] = '3';
            } else {
                if (array[1] <= '3')
                    array[0] = '2';
                else
                    array[0] = '1';
            }
        }
        if (array[1] == '?') {
            if (array[0] == '2')
                array[1] = '3';
            else
                array[1] = '9';
        }
        if (array[3] == '?')
            array[3] = '5';
        if (array[4] == '?')
            array[4] = '9';
        return new String(array);
    }
}
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/latest-time-by-replacing-hidden-digits/
Simple Sticky footer Ads
Tags: css, javascript, html, wordpress
Published: 2022-07-21 14:49:00

Please install it on Blogspot or WordPress. This is Sticky footer for ads and method is the simplest way to add Responsive [Sticky Footer Ads](https://www.bianity.net) in WordPress and Sticky Footer Ads on your Blogger Website.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fo5o7oc1v2evaw3qgsvv.jpg)

```
<style>
.Bianity-ads {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	min-height: 70px;
	max-height: 90px; /* www.bianity.net */
	padding: 5px 0;
	box-shadow: 0 -6px 18px 0 rgba(9,32,76,.1);
	-webkit-transition: all .1s ease-in;
	transition: all .1s ease-in;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #fefefe;
	z-index: 20;
}

.Bianity-ads-close {
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px 0 0;
	position: absolute;
	right: 0;
	top: -30px;
	background-color: #fefefe;
	box-shadow: 0 -6px 18px 0 rgba(9,32,76,.08);
}

.Bianity-ads .Bianity-ads-close svg {
	width: 22px;
	height: 22px;
	fill: #000;
}

.Bianity-ads .Bianity-ads-content {
	overflow: hidden;
	display: block;
	position: relative;
	text-align:center;
	height: 70px;
	width: 100%;
	margin-right: 10px;
	margin-left: 10px;
}
</style>


<div class='Bianity-ads' id='Bianity-ads'>
	<div class='Bianity-ads-close' onclick='document.getElementById(&quot;Bianity-ads&quot;).style.display=&quot;none&quot;'>
		<svg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'>
			<path d='M278.6 256l68.2-68.2c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-68.2-68.2c-6.2-6.2-16.4-6.2-22.6 0-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3l68.2 68.2-68.2 68.2c-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3 6.2 6.2 16.4 6.2 22.6 0l68.2-68.2 68.2 68.2c6.2 6.2 16.4 6.2 22.6 0 6.2-6.2 6.2-16.4 0-22.6L278.6 256z' />
		</svg>
	</div>
	<div class='Bianity-ads-content'> Place your Ad Code </div>
</div>
```
1800. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:48:37

```
class Solution {
public:
    int maxAscendingSum(vector<int>& nums) {
        int ans = nums[0];
        
        int cur = nums[0];
        for (int i = 1; i < nums.size(); i++) {
            if (nums[i] > nums[i-1]) {
                cur += nums[i];
            } else {
                cur = nums[i];
            }
            ans = max(ans, cur);
        }
        
        return ans;
    }
};
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/maximum-ascending-subarray-sum/
1556. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:46:47

```
class Solution {
public:
    string thousandSeparator(int n) {
        if(n == 0) return "0";
        
        string ans = "";
        
        while(n){
            string tmp = to_string(n%1000);
            /*
            need to pad 0 for the case:
            51040
            */
            if(tmp.size() < 3 && n >= 1000){
                tmp = string(3-tmp.size(), '0') + tmp;
            }
            if(ans.empty()){
                ans = tmp;
            }else{
                ans = tmp + "." + ans;
            }
            n /= 1000;
            // cout << ans << endl;
        }
        
        return ans;
    }
};
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/thousand-separator/
1544. Leetcode Solution in Java
Tags: java
Published: 2022-07-21 14:45:39

```
class Solution {
   public String makeGood(String s) {
    char[] arr = s.toCharArray();
    int n = arr.length;
    LinkedList<Character> list = new LinkedList<>();
    for(int i = 0; i < n; i++){
        if(!list.isEmpty()){
            if(Math.abs(list.getLast() - arr[i]) == 'a' - 'A'){
                list.removeLast();
                continue;
            }
        }
        if(i + 1 != n && Math.abs(arr[i + 1] - arr[i]) == 'a' - 'A') i++;
        else list.add(arr[i]);
    }
    StringBuilder sb = new StringBuilder();
    while(!list.isEmpty()){
        sb.append(list.removeFirst());
    }
    return sb.toString();
}
}
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/make-the-string-great/
the POWER of networking
Published: 2022-07-21 14:44:29

For most, IT is just a means of getting good money, another part is about something else and so on. Then there´s a really small amount of professionals who want to make a change. BE great, and partake in incredible revolutionary projects. One thing (not only this though) that all of them have in common is the necessity of creating a network. For some, this comes naturally, for others (introverts specifically) it´s hard as `#3ll`. Although it's not the same for everyone, it's result can reward everyone.

Sites such as `Linkedin` (and many local ones) tend to provide this, while also showcasing your portfolio and other information that can and will help you reach your goals. Some of these even have their own english (for non-english speakers) and technical tests that will also boost your profile and help you reach them faster. I don't know about you, but, I love to have everything ready for a change. Specially if it's a boost in my career.

Here's my [GitHub](github.com/mateusloubach), if you don't have an idea where to start. 

Make sure you give me a star, if you're finding any of this interesting.
1534. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:44:23

```
   class Solution {
public:
    int countGoodTriplets(vector<int>& A, int a, int b, int c) {
        int N = A.size(), ans = 0;
        for (int i = 0; i < N; ++i) {
            for (int j = i + 1; j < N; ++j) {
                for (int k = j + 1; k < N; ++k) {
                    if (abs(A[i] - A[j]) <= a && abs(A[j] - A[k]) <= b && abs(A[i] - A[k]) <= c) ++ans;
                }
            }
        }
        return ans;
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/count-good-triplets/
1518. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:40:18

```
class Solution {
 public:
  int numWaterBottles(int numBottles, int numExchange) {
    int ans = numBottles;

    while (numBottles >= numExchange) {
      ans += numBottles / numExchange;
      numBottles = numBottles / numExchange + numBottles % numExchange;
    }

    return ans;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/water-bottles/
1512. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:39:23

```
class Solution {
 public:
  int numIdenticalPairs(vector<int>& nums) {
    int ans = 0;
    vector<int> count(101);

    for (const int num : nums)
      ans += count[num]++;

    return ans;
  }
};

```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/number-of-good-pairs/
1496. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:38:31

```
class Solution {
 public:
  bool isPathCrossing(string path) {
    set<int> seen;

    seen.insert(0);

    int x = 0;
    int y = 0;

    for (const char c : path) {
      switch (c) {
        case 'N':
          ++y;
          break;
        case 'S':
          --y;
          break;
        case 'E':
          ++x;
          break;
        case 'W':
          --x;
          break;
      }
      const int key = x * 20001 + y;
      if (seen.count(key)) return true;
      seen.insert(key);
    }

    return false;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/path-crossing/
1486. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:37:25

```
class Solution {
public:
    int xorOperation(int n, int start) {
        int res = start;
        for(int i=1; i<n; i++) res ^= start+2*i;
        return res;
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/xor-operation-in-an-array/
1475. Leetcode Solution in Python
Tags: python
Published: 2022-07-21 14:36:14

```
class Solution:
    def finalPrices(self, prices):
        ans=[]
        stack=[0]
        for x in prices[::-1]:
            while x < stack[-1]: stack.pop()
            ans += [x - stack[-1]]
            stack.append(x)
        return ans[::-1]
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop/
1470. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:35:11

```
class Solution {
public:
    vector<int> shuffle(vector<int>& nums, int n) {
        vector<int> ans(2*n, 0);
        for(int i = 0, j = 0; i < n; i++, j+=2){
            ans[j] = nums[i];
            ans[j+1] = nums[i+n];
        }
        return ans;
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/shuffle-the-array/
2016. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:33:32

```
class Solution {
 public:
  int maximumDifference(vector<int>& nums) {
    int ans = -1;
    int min = nums[0];

    for (int i = 1; i < nums.size(); ++i) {
      if (nums[i] > min)
        ans = max(ans, nums[i] - min);
      min = std::min(min, nums[i]);
    }

    return ans;
  }
};

```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/maximum-difference-between-increasing-elements/
2000. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:32:44

```
class Solution {
 public:
  string reversePrefix(string word, char ch) {
    reverse(begin(word), begin(word) + word.find(ch) + 1);
    return word;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/reverse-prefix-of-word/
1995. Leetcode Solution in Java
Tags: java
Published: 2022-07-21 14:31:55

```
class Solution {
    public int countQuadruplets(int[] nums) {
        int count = 0;
        int length = nums.length;
        for (int i = 0; i < length - 3; i++) {
            for (int j = i + 1; j < length - 2; j++) {
                for (int k = j + 1; k < length - 1; k++) {
                    int sum = nums[i] + nums[j] + nums[k];
                    for (int m = k + 1; m < length; m++) {
                        if (sum == nums[m])
                            count++;
                    }
                }
            }
        }
        return count;
    }
}
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/count-special-quadruplets/
2103. Leetcode Solution in cpp
Tags: cpp
Published: 2022-07-21 14:30:33

```
class Solution {
 public:
  int countPoints(string rings) {
    vector<int> colors(10);

    for (int i = 0; i < rings.length(); i += 2) {
      const int c = rings[i];
      const int color = c == 'R' ? 1 : c == 'G' ? 2 : 4;
      colors[rings[i + 1] - '0'] |= color;
    }

    return count(begin(colors), end(colors), 7);
  }
};

```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/rings-and-rods/
Paracetamol.js💊| #172: Explica este código JavaScript
Tags: javascript, spanish, webdev, programming
Published: 2022-07-21 14:29:41

## **<center>Explica este código JavaScript</center>**
#### <center>**Dificultad:** <mark>Intermedio</mark></center>

```js
console.log(Object.assign({}, { a: 1, b: 2 }));
```

A. `ReferenceError: {} is not defined`
B. `{}`
C. `{ a: 1,  b:2 }`
D. `{ a: 1,  b:2, {} }`

Respuesta en el primer comentario.

---
1455. Leetcode Solution in Java
Tags: java
Published: 2022-07-21 14:29:19

```
class Solution {
   public int isPrefixOfWord(String sentence, String searchWord) {
    int res = -1;
    String[] arr = sentence.split(" ");
    for(int i = 0; i < arr.length; i++){
        if(arr[i].startsWith(searchWord)){
            return i + 1;
        }
    }
    return res;
}
}
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
My Dev Experience Season 1 Ep 1
Tags: coding, software, python
Published: 2022-07-21 14:28:46

Hello World
I'm a 25 year old developer in a developing country **Zimbabwe** 
I've always been a fan of technology being inspired by movies the likes of:

- Iron Man
- I-robot
- Transformers
- Matrix
- Terminator
and many more

I started learning coding when I was 18 years old that was back in 2015 my first actual OOP language I did was java after doing some basic HTML, CSS and a bit of JavaScript.

I wasn't really a Js fan and thought I would do away with without Js... as I did more and more of web dev I realized that I there was no escape from Js.
This then prompted me to switch to developing PC applications
Just as I was about to totally fall in love with java my laptop got stolen and went for a year without a laptop and then when I git another laptop... I had discovered python programming language 
and fell in love with it that was in 2017
I've been a python developer ever since with a mix of C# and a little bit of Java 

So basically I would say I'm a python developer at heart and also able to learn other languages as well. and I guess I find it very easy to learn new languages because before becoming a python developer I did a whole bunch of programming and scripting languages, trying to find the one I felt a connection with a list of languages I looked into where:

- Php
- c/c++
- Ruby
- Perl
- shell
- batch

I will be share my story to becoming a developer from being a total noob to being employed as a developer
1295. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:26:03

```
class Solution {
 public:
  int findNumbers(vector<int>& nums) {
    int ans = 0;

    for (int num : nums)
      if (9 < num && num < 100 || 999 < num && num < 10000 || num == 100000)
        ++ans;

    return ans;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/find-numbers-with-even-number-of-digits/
1287. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:25:12

```
class Solution {
 public:
  int findSpecialInteger(vector<int>& arr) {
    const int n = arr.size();
    const int quarter = n / 4;

    for (int i = 0; i < n - quarter; ++i)
      if (arr[i] == arr[i + quarter]) return arr[i];

    throw;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array/
1221. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:24:22

```
class Solution {
public:
    int balancedStringSplit(string s) {
        int i, n = s.length(), R = 0, cnt = 0;
        for(i = 0; i < n; i++){
            if(s[i] == 'R'){
                R++;
                
                if(R == 0) cnt++;
            }
            else
            {
                R--;
                if(R == 0) cnt++;
            }
        }
        
        return cnt;
    }
};
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/split-a-string-in-balanced-strings/
1103. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:23:11

```
class Solution {
 public:
  vector<int> distributeCandies(int candies, long n) {
    vector<int> ans(n);
    int rows = (-n + sqrt(n * n + 8 * n * n * candies)) / (2 * n * n);
    int accumN = rows * (rows - 1) * n / 2;

    for (int i = 0; i < n; ++i)
      ans[i] = accumN + rows * (i + 1);

    int givenCandies = (n * n * rows * rows + n * rows) / 2;
    candies -= givenCandies;

    for (int i = 0, lastGiven = rows * n + 1; candies > 0; ++i, ++lastGiven) {
      int actualGiven = min(lastGiven, candies);
      candies -= actualGiven;
      ans[i] += actualGiven;
    }

    return ans;
  }
};

```


#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/distribute-candies-to-people
1443. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:21:56

```
class Solution {
 public:
  int minTime(int n, vector<vector<int>>& edges, vector<bool>& hasApple) {
    vector<vector<int>> graph(n);

    for (const auto& e : edges) {
      const int u = e[0];
      const int v = e[1];
      graph[u].push_back(v);
      graph[v].push_back(u);
    }

    return dfs(graph, 0, vector<bool>(n), hasApple);
  }

 private:
  int dfs(const vector<vector<int>>& graph, int u, vector<bool>&& seen,
          const vector<bool>& hasApple) {
    seen[u] = true;
    int totalCost = 0;

    for (const int v : graph[u]) {
      if (seen[v])
        continue;
      const int cost = dfs(graph, v, move(seen), hasApple);
      if (cost > 0 || hasApple[v])
        totalCost += cost + 2;
    }

    return totalCost;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/minimum-time-to-collect-all-apples-in-a-tree/
🚀 DownTube - Content Downloader
Tags: django, python, webdev, programming
Published: 2022-07-21 14:21:00

{% embed https://www.youtube.com/watch?v=JujPb6q37ZQ %}

It is a free-to-use - content downloader service that works upon many open source APIs. 

####💫 Features

Using the shared 🔗 link, now you can download

- YouTube Video + Shorts

- YouTube Music + Spotify Song + Apple Music

100% Free + Unlimited downloads with No Ads 🤯.

Built with Fast and Safe nature.

100% responsive design.

####🔨 Tools used

- Front-end language used HTML, CSS and JavaScript.
- Backend language used Django framework (Python) and SQL for -database. 
- File handling using Python.
- List of APIs used:
- Google APIs
- Spotify APIs
- And many other python unofficial APIs.
 
Source Code: https://github.com/dev3058/downtube-web-app

Check out: [🤔 How 🚀 DownTube Download is better than Spotify](https://blog.3058.in/2022/06/how-downtube-download-is-better-than-spotify.html)


{% embed http://feeds.feedburner.com/~r/developer-zone/~6/1 %}
1315. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:20:55

```
class Solution {
    int ans = 0;
    vector<TreeNode*> v;
    void preorder(TreeNode *root, int level) {
        if (!root) return;
        if (v.size() <= level) v.push_back(root);
        else v[level] = root;
        if (level - 2 >= 0 && v[level - 2]->val % 2 == 0) ans += root->val;
        preorder(root->left, level + 1);
        preorder(root->right, level + 1);
    }
public:
    int sumEvenGrandparent(TreeNode* root) {
        preorder(root, 0);
        return ans;
    }
};
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent/
2289. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-21 14:19:38

```
class Solution {
 public:
  int totalSteps(vector<int>& nums) {
    // dp[i] := # of steps to remove nums[i]
    vector<int> dp(nums.size());
    stack<int> stack;

    for (int i = 0; i < nums.size(); ++i) {
      int step = 1;
      while (!stack.empty() && nums[stack.top()] <= nums[i])
        step = max(step, dp[stack.top()] + 1), stack.pop();
      if (!stack.empty())
        dp[i] = step;
      stack.push(i);
    }

    return *max_element(begin(dp), end(dp));
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/steps-to-make-array-non-decreasing/
1653. Leetcode Solution in Python3
Tags: python
Published: 2022-07-21 14:18:13

```
class Solution:
    def minimumDeletions(self, s: str) -> int:
        count_a=s.count('a')
        count_b=0
        res=float('inf')
        for ch in s:
            if(ch=='a'): 
                count_a-=1
                res=min(res,count_a+count_b)
            elif(ch=='b'):
                count_b+=1
                res=min(res,count_a+count_b-1)
        return res
```


#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/minimum-deletions-to-make-string-balanced