🚀 Day 40/150 of hashtag#150DaysOfDSA 📌 Task: Find Target Indices After Sorting Array You are given a 0-indexed integer array nums and a target element target. A target index is an index i such that nums[i] == target. Return a list of the target indices of nums after sorting nums in non-decreasing order. If there are no target indices, return an empty list. The returned list must be sorted in increasing order. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
Find Target Indices After Sorting Array
More Relevant Posts
-
🚀 Day 49/150 of hashtag#150DaysOfDSA 📌 Task: Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
day 15 of 2021 days. Undirected graph using adjancency matrix where [i][i] are zero to avoid self loops. We need to find the degree of the vertex. Constraints are small enough for linear brute force. #PROBLEM: 3898. Find the Degree of Each Vertex #SOLUTION: class Solution: def findDegrees(self, matrix: list[list[int]]) -> list[int]: return [sum(row) for row in matrix] #SoftwareEngineering #SystemDesign #Algorithms #ProblemSolving #BackendDevelopment
To view or add a comment, sign in
-
-
🚀 Day 42/150 of hashtag#150DaysOfDSA 📌 Task: Binary Search Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. You must write an algorithm with O(log n) runtime complexity. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
DAY->20 Solved “Valid Anagram” with an optimal approach 🚀 Initially, I considered using sorting to compare both strings. While that works, it results in O(n log n) time complexity. Then I optimized the approach using a frequency array (hashing technique): Traverse both strings once Increment count for characters in s Decrement count for characters in t Finally check if all values are zero This reduces the complexity to: Time: O(n) Space: O(1) (fixed 26-size array) Key insight: Instead of rearranging strings (sorting), we can directly compare their character distributions. Result: ✔ 100% runtime efficiency ✔ Constant space usage ✔ Clean and scalable solution This problem reinforced an important lesson: -> Always look for ways to replace sorting with counting when dealing with character-based problems. #DataStructures #Algorithms #Cpp #CodingInterview #LeetCode #ProblemSolving
To view or add a comment, sign in
-
-
Maximum distance between a pair of values Given nums1 and nums2 🎯Target: Max distance (j - i) such that i <= j and nums1[i] <= nums2[j] Thought process... We'll iterate over nums1 and for each index i, we need to find a valid j in nums2. At first, can think of linear search… but wait 🤔 Both arrays are sorted in non-increasing order, so we can do better Instead of scanning, we use binary search on nums2 to find the rightmost index j such that: nums2[j] >= nums1[i] j found, then compute j - i and update our answer. And yeah… that’s pretty much it. Clean and efficient😄 #potd #DSA #Algorithms #BinarySearch #problemSolving
To view or add a comment, sign in
-
-
🚀 Day 11 of #DSA 🔹 Problem Solved: Binary Search 🔹 Approach: Applied binary search on a sorted array to efficiently find the target element 📌 Key Learning: Learned how dividing the search space in half reduces time complexity from O(n) to O(log n), making the solution much faster for large inputs. Stepping into optimized problem-solving 🚀 #DataStructures #Algorithms #BinarySearch #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 52/150 of hashtag#150DaysOfDSA 📌 Task: Find the Added Integer You are given two arrays of equal length, nums1 and nums2. Each element in nums1 has been increased (or decreased, in case of negative) by an integer x. As a result, nums1 becomes equal to nums2. Two arrays are considered equal when they contain the same integers with the same frequencies. Return the integer x. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
I tested some of the newer document extraction models recently on real-world mining exploration data, and the results were a useful reminder: - Reading a document is not the same as extracting the right data from it. - That gap matters a lot when teams are working with complex reports, tables, scanned records, and inconsistent layouts. I’ve spent close to a decade working on document and image-based data extraction, starting with multilingual medical documents and scanned files for a major Swiss pharmaceutical company, and now applying that experience to mining exploration data. My view is simple: Off-the-shelf models can help, but they rarely solve the full problem on their own. In real business workflows, you often need: • Strong OCR or document intelligence as the base • Coordinate and layout-aware extraction • Validation rules • Custom logic for the specific document type • A workflow that handles exceptions cleanly The real value comes from the custom layer built around the documents your team actually deals with every day. That is where a lot of manual work can be removed. If your team is still spending hours entering data from technical documents into spreadsheets or internal systems, there is a good chance much of that can be automated without building a large internal team around it. I work with a highly efficient stack of custom workflows and AI agents to help businesses automate complex document processing without the overhead of a large team. If you have a document-heavy workflow and want to explore what is possible, I’m happy to offer a free proof of concept. Feel free to message me or comment “automation”.
Machine Learning Librarian at Hugging Face 🤗 | Making AI work for libraries, archives, and their communities
Is #OCR almost solved, or are we just running out of ways to measure progress? The top score on olmOCR-bench is now 85.9%. A year ago it was 79%. The leaderboard is getting crowded at the top. I built a bar chart race to show how these rankings evolve over time, using data from Hugging Face Dataset Leaderboards. This week alone, three new OCR models dropped: - chandra-ocr-2 (Datalab) — #1 at 85.9%. 5.3B params, down from 8.8B in v1. 90+ language support, major improvements to math, tables, and complex layouts. Smaller AND better. - dots.ocr-1.5 (rednote) — #2 at 83.9% with just 3B params. Can convert charts, diagrams, and chemical formulas directly to SVG. Strong multilingual document parsing. - Qianfan-OCR (Baidu, Inc.) — 79.8% on olmOCR-bench but #1 on OmniDocBench v1.5 and Key Information Extraction benchmarks. 4.7B params, 192 languages, and a novel "Layout-as-Thought" approach. Apache 2.0 licensed. What's also important is the efficiency trend. LightOn hit 83.2% back in January with just 1B parameters. Models are getting dramatically smaller while scores keep climbing. This is important because OCR is foundational infrastructure — document processing, digitization, accessibility, data pipelines. Smaller models = cheaper to deploy = more accessible. I'm more excited at the moment about a model that is slightly below SOTA if it's very small fast and efficient to run. https://lnkd.in/eV9iGnxK
To view or add a comment, sign in
-
Day 106 ✅ Solved: 3488. Closest Equal Element Queries (Medium) Today’s problem was a great mix of hashing + binary search + circular array logic. 💡 Key Idea: Store indices of each number using a hashmap For each query, find the closest index with the same value Use binary search to efficiently locate neighbors Handle circular nature carefully (wrap-around distance) ⚡ What I Learned: Preprocessing can drastically reduce query time Binary search isn’t just for sorted arrays—it’s powerful with index mapping Always consider edge cases like circular distance 📊 Performance: Runtime: 200 ms Beat: 74% Every day, I’m getting better at recognizing patterns and optimizing solutions. Consistency is paying off. 🔁 On to Day 107! #LeetCode #DataStructures #Algorithms #CodingJourney #Consistency #Learning #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 35/150 of hashtag#150DaysOfDSA 📌 Task: Linked List Creation (Advanced DSA) Create a singly linked list by inserting multiple nodes at the end and display the complete list. Each node should store an integer value and a pointer to the next node. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development