Find Max In Rotated Sorted Array (medium)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) { ...Jun 17, 2024·1 min read
Max Consecutive Ones IIIclass Solution { public: int longestOnes(vector<int>& nums, int k) { int l = 0, r = 0; int a[10]{}; int ans = 0; while(r < nums.size()) { int count_zeros = 0; else if(nums[r] == 0) ...May 22, 2024·1 min read
3090. Maximum Length Substring With Two Occurrencesclass Solution { public: int maximumLengthSubstring(string s) { int m1[26]{}; int count = 0; // sliding window part for(int l = 0, r = 0; r < s.length(); ++r) { int a = s[r] - 'a'; ...May 22, 2024·1 min read
Cve-2024-3094Recently, a backdoor has been discovered by a user of Linux package called XZ-utils, which is used for compression and lossless compression, this package comes preinstalled with many Debian based and other distributions of Linux. software developer ...Apr 2, 2024·3 min read
Leetcode 424: longest repeating character replacementI am writing this explanation, because I came across this question, and it has a really bad description, it is a sliding window problem, but the size of the window is reduced due to a specific condition that we will see in the code, no good explanati...Mar 28, 2024·1 min read
Basic terminologies of ethical hackingwhat is offensive security? offensive security: using ethical cybersecurity techniques to make an organization's security robust, this mainly includes various types of penetration testing, and writing a report, and I will discuss those down. Facets o...Oct 7, 2023·3 min read