---
title: "Ashir (@AshirMehmood) | Hashnode"
description: "Ashir (@AshirMehmood) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@AshirMehmood"
---

@AshirMehmood

# Ashir

@AshirMehmood · Joined July 2023

### [Find Max In Rotated Sorted Array (medium)](https://ashirmehmood.hashnode.dev/find-max-in-rotated-sorted-array-medium?utm_source=hashnode&utm_medium=feed)

class Solution { public: int findMin(vector<int>& nums) { int n = nums.size() - 1; if (nums\[0\] <= nums\[n\]) { return nums\[0\]; } int l = 0, r = n, m = 0; while(l <= r) { ...

1 min read · [ashirmehmood.hashnode.dev](https://ashirmehmood.hashnode.dev/find-max-in-rotated-sorted-array-medium?utm_source=hashnode&utm_medium=feed)

[Jun 17, 2024](https://hashnode.com/posts/find-max-in-rotated-sorted-array-medium/6670a8f4adf55e9ae9cc916c)

### [Count of Positive and Negative Integers](https://ashirmehmood.hashnode.dev/count-of-positive-and-negative-integers?utm_source=hashnode&utm_medium=feed)

\# written by Ashir O(logn) class Solution: def maximumCount(self, nums: List\[int\]) -> int: l, r = 0, len(nums) - 1 count\_pos = 0 count\_neg = 0 zeros = 0 if nums\[0\] == 0 and nums\[-1\] == 0: retu...

1 min read · [ashirmehmood.hashnode.dev](https://ashirmehmood.hashnode.dev/count-of-positive-and-negative-integers?utm_source=hashnode&utm_medium=feed)

[Jun 12, 2024](https://hashnode.com/posts/count-of-positive-and-negative-integers/666a22b68a7ac5dfc4098d35)

### [Find Minimum in Rotated Sorted Array](https://ashirmehmood.hashnode.dev/find-minimum-in-rotated-sorted-array?utm_source=hashnode&utm_medium=feed)

\# written by Ashir class Solution: def findMin(self, nums: List\[int\]) -> int: m = nums\[0\] mid = 0 if len(nums) == 1: return nums\[0\] for i in range(len(nums) - 1): if nums\[i + 1\] < nums\[i\]: ...

1 min read · [ashirmehmood.hashnode.dev](https://ashirmehmood.hashnode.dev/find-minimum-in-rotated-sorted-array?utm_source=hashnode&utm_medium=feed)

[Jun 7, 2024](https://hashnode.com/posts/find-minimum-in-rotated-sorted-array/6662e4c8d20d673962abcf6b)

### [Search In 2D Array](https://ashirmehmood.hashnode.dev/search-in-2d-array?utm_source=hashnode&utm_medium=feed)

// Written by Ashir class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { return search(matrix, target); } bool search(vector<vector<int>>& matrix, int& t) { if(matrix.size() == 0) ...

1 min read · [ashirmehmood.hashnode.dev](https://ashirmehmood.hashnode.dev/search-in-2d-array?utm_source=hashnode&utm_medium=feed)

[Jun 4, 2024](https://hashnode.com/posts/search-in-2d-array/665f69bcfce6955901df4bc3)

### [1475\. Final Prices With a Special Discount in a Shop (Easy)](https://ashirmehmood.hashnode.dev/1475-final-prices-with-a-special-discount-in-a-shop-easy?utm_source=hashnode&utm_medium=feed)

// next smaller number - monotonic stack class Solution { public: vector<int> finalPrices(vector<int>& prices) { int n = prices.size(); std::vector<int> ans(n); std::stack<int> s; for(int i = 0; i < prices.size(); i++) { ...

1 min read · [ashirmehmood.hashnode.dev](https://ashirmehmood.hashnode.dev/1475-final-prices-with-a-special-discount-in-a-shop-easy?utm_source=hashnode&utm_medium=feed)

[May 26, 2024](https://hashnode.com/posts/1475-final-prices-with-a-special-discount-in-a-shop-easy/6652ffc776210d9b5a6b6109)
