question_slug stringlengths 3 77 | title stringlengths 1 183 | slug stringlengths 12 45 | summary stringlengths 1 160 ⌀ | author stringlengths 2 30 | certification stringclasses 2
values | created_at stringdate 2013-10-25 17:32:12 2025-04-12 09:38:24 | updated_at stringdate 2013-10-25 17:32:12 2025-04-12 09:38:24 | hit_count int64 0 10.6M | has_video bool 2
classes | content stringlengths 4 576k | upvotes int64 0 11.5k | downvotes int64 0 358 | tags stringlengths 2 193 | comments int64 0 2.56k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
number-of-orders-in-the-backlog | Go solution using library in leetcode | go-solution-using-library-in-leetcode-by-ocfa | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Overmachine | NORMAL | 2024-09-28T02:42:52.545091+00:00 | 2024-09-28T02:42:52.545134+00:00 | 5 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['Go'] | 0 |
number-of-orders-in-the-backlog | Javascript solution | javascript-solution-by-overmachine-dcpu | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Overmachine | NORMAL | 2024-09-28T00:54:04.838065+00:00 | 2024-09-28T00:54:04.838097+00:00 | 5 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['JavaScript'] | 0 |
number-of-orders-in-the-backlog | C# Priority Queue-Based Solution | c-priority-queue-based-solution-by-getri-0ckc | Intuition\n Describe your first thoughts on how to solve this problem. \nTo solve the problem of processing orders and managing the backlog, we can use two prio | GetRid | NORMAL | 2024-09-09T15:16:14.386501+00:00 | 2024-09-09T15:16:14.386544+00:00 | 5 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTo solve the problem of processing orders and managing the backlog, we can use two priority queues (heaps) to efficiently match buy and sell orders:\n\nBuy Orders: We need a max-heap to store the buy orders because we want to match the hi... | 0 | 0 | ['Array', 'Heap (Priority Queue)', 'Simulation', 'C#'] | 0 |
number-of-orders-in-the-backlog | A intuitive solution in C++ | a-intuitive-solution-in-c-by-wkelvinson-usnz | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | wkelvinson | NORMAL | 2024-09-08T23:15:15.228182+00:00 | 2024-09-08T23:15:15.228213+00:00 | 5 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | EASY AND UNDERSTANDABLE | easy-and-understandable-by-animesh_maury-iiip | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Animesh_Maurya | NORMAL | 2024-09-06T06:59:37.029071+00:00 | 2024-09-06T06:59:37.029104+00:00 | 4 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['Array', 'Heap (Priority Queue)', 'Simulation', 'C++'] | 0 |
number-of-orders-in-the-backlog | Using 2 heaps. Runtime top 90% Memory top 80% | using-2-heaps-runtime-top-90-memory-top-o7q9e | Approach\nThe solution uses two heaps: a max heap for buy orders and a min heap for sell orders, making it easy to get the highest buy price and the lowest sell | JonathanMeiri | NORMAL | 2024-08-29T10:26:55.049860+00:00 | 2024-08-29T10:26:55.049888+00:00 | 4 | false | # Approach\nThe solution uses two heaps: a max heap for buy orders and a min heap for sell orders, making it easy to get the highest buy price and the lowest sell price quickly. As we go through each order, we add it to the right heap based on whether it\'s a buy or sell order. We then check if any buy and sell orders ... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | [C++] Simply Solution - Very Easy to Understand | c-simply-solution-very-easy-to-understan-vnq3 | Intuition\nThis is a simple matching algorithm / orderbook problem, common in financial markets.\n\n# Approach\n Describe your approach to solving the problem. | leetcodegrindtt | NORMAL | 2024-08-16T01:41:26.775942+00:00 | 2024-08-16T01:41:26.775971+00:00 | 2 | false | # Intuition\nThis is a simple matching algorithm / orderbook problem, common in financial markets.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | C++ priority queue | c-priority-queue-by-ckousik-kheg | Intuition\n Describe your first thoughts on how to solve this problem. \nThe requirement is to fetch the largest existing buy orders or the smallest existing se | ckousik | NORMAL | 2024-07-31T14:38:50.657263+00:00 | 2024-07-31T14:38:50.657290+00:00 | 3 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe requirement is to fetch the largest existing buy orders or the smallest existing sell orders. We need to be able to retrieve buy or sell orders in a sorted manner. A priority_queue/heap helps with this.\n\n# Approach\n<!-- Describe yo... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | C++ priority_queue solution | c-priority_queue-solution-by-jcodefun-dli8 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | JCodeFun | NORMAL | 2024-07-15T08:48:30.339214+00:00 | 2024-07-15T08:48:30.339236+00:00 | 1 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n log n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g.... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | two heaps implementation | two-heaps-implementation-by-jcodefun-6vxs | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | JCodeFun | NORMAL | 2024-07-15T07:32:48.651393+00:00 | 2024-07-15T07:32:48.651423+00:00 | 26 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n log n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g.... | 0 | 0 | ['Python3'] | 0 |
number-of-orders-in-the-backlog | Using heap | using-heap-by-vmulani-m9yl | Intuition\nWe need to maintain backlog of sellOrders in minimum price order and backlog of buyOrders in maximum price order. This implies the datastructure we u | vmulani | NORMAL | 2024-07-13T13:24:05.727819+00:00 | 2024-07-13T13:24:05.727860+00:00 | 2 | false | # Intuition\nWe need to maintain backlog of sellOrders in minimum price order and backlog of buyOrders in maximum price order. This implies the datastructure we use must maintain records in sorted order and every time an order is executed completely, the next order must take its place. This is a good fit for Heap datas... | 0 | 0 | ['Java'] | 0 |
number-of-orders-in-the-backlog | python min + max heap | python-min-max-heap-by-harrychen1995-pgjd | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | harrychen1995 | NORMAL | 2024-06-26T13:49:07.588729+00:00 | 2024-06-26T13:49:07.588750+00:00 | 28 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['Heap (Priority Queue)', 'Python3'] | 0 |
number-of-orders-in-the-backlog | Simple Approach using Heap | simple-approach-using-heap-by-tesla_arc-7de4 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Tesla_Arc | NORMAL | 2024-06-24T14:41:59.551819+00:00 | 2024-06-24T14:41:59.551851+00:00 | 7 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | 1801. Number of Orders in the Backlog.cpp | 1801-number-of-orders-in-the-backlogcpp-6l9wj | Code\n\nclass Solution {\npublic:\n int getNumberOfBacklogOrders(vector<vector<int>>& orders) {\n priority_queue<pair<int, int>> buy; \n priori | 202021ganesh | NORMAL | 2024-06-17T07:50:52.854728+00:00 | 2024-06-17T07:50:52.854749+00:00 | 2 | false | **Code**\n```\nclass Solution {\npublic:\n int getNumberOfBacklogOrders(vector<vector<int>>& orders) {\n priority_queue<pair<int, int>> buy; \n priority_queue<pair<int, int>, vector<pair<int, int>>, greater<>> sell; \n for (auto& order : orders) {\n auto price = order[0], qty = order[... | 0 | 0 | ['C'] | 0 |
number-of-orders-in-the-backlog | Production Ready Solution: Min Heap - Max Heap Approach (Python) | production-ready-solution-min-heap-max-h-mziv | Approach\nUse Max Heap to store buy orders\nUse Min Heap to store sell orders\n\neach heap item should store a tuple of (price, amount)\n\n# Complexity\n- Time | adityachandra | NORMAL | 2024-06-11T14:42:15.572704+00:00 | 2024-06-11T14:42:15.572743+00:00 | 4 | false | # Approach\nUse Max Heap to store buy orders\nUse Min Heap to store sell orders\n\neach heap item should store a tuple of (price, amount)\n\n# Complexity\n- Time complexity: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['Python'] | 0 |
number-of-orders-in-the-backlog | Easy python solution (priority queue) | easy-python-solution-priority-queue-by-i-yml0 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | idoedo | NORMAL | 2024-06-10T06:54:32.598636+00:00 | 2024-06-10T06:54:32.598668+00:00 | 25 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['Python3'] | 0 |
number-of-orders-in-the-backlog | Two steps. Easy | two-steps-easy-by-vokasik-2b9m | Only 2 steps:\n1. Add an order to one of the heaps: min_heap for sell, max_heap for buy\n2. Process orders in the heaps\n\nclass Solution:\n def getNumberOfB | vokasik | NORMAL | 2024-05-20T09:12:44.086104+00:00 | 2024-05-20T09:12:44.086136+00:00 | 21 | false | Only 2 steps:\n1. Add an order to one of the heaps: min_heap for sell, max_heap for buy\n2. Process orders in the heaps\n```\nclass Solution:\n def getNumberOfBacklogOrders(self, orders: List[List[int]]) -> int:\n min_sell = [] # buy: smallest sell <= buy\n max_buy = [] # sell: biggest buy >= sell\n ... | 0 | 0 | ['Heap (Priority Queue)', 'Python', 'Python3'] | 0 |
number-of-orders-in-the-backlog | easy approach!! Just a bit of priority queue knowledge and its really easy | easy-approach-just-a-bit-of-priority-que-q8p8 | Intuition\n Describe your first thoughts on how to solve this problem. \nI am a stock market guy. So appeared easy for me to understand. Just try to understand | gaurav_17_18 | NORMAL | 2024-05-18T04:25:23.706387+00:00 | 2024-05-18T04:25:23.706411+00:00 | 0 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nI am a stock market guy. So appeared easy for me to understand. Just try to understand the problem statement and it will be a matter of minutes to solve this.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nyou can u... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | [C++] 2 Approaches, Max-Heap (Bids) and Min-Heap (Asks), Level 2 Quotes Processing | c-2-approaches-max-heap-bids-and-min-hea-enzn | Complexity\n- Time complexity: O(nlogn)\n- Space complexity: O(n)\n\n# Code\n## Approach 1 (First Push to Heap, then Match)\n\nclass Solution {\npublic:\n in | amanmehara | NORMAL | 2024-05-17T04:31:27.832711+00:00 | 2024-05-17T04:49:24.228948+00:00 | 6 | false | # Complexity\n- Time complexity: $$O(nlogn)$$\n- Space complexity: $$O(n)$$\n\n# Code\n## Approach 1 (First Push to Heap, then Match)\n```\nclass Solution {\npublic:\n int getNumberOfBacklogOrders(vector<vector<int>>& orders) {\n priority_queue<pair<int, int>> bids;\n priority_queue<pair<int, int>> ask... | 0 | 0 | ['Heap (Priority Queue)', 'Simulation', 'C++'] | 0 |
number-of-orders-in-the-backlog | N Log N + clean code | n-log-n-clean-code-by-gautii0911-bv5k | \n\n# Code\n\nimport java.util.PriorityQueue;\n\nclass Solution {\n\n // Nested class representing a buy order\n public class Buy {\n int price;\n | gautii0911 | NORMAL | 2024-05-11T16:57:23.271408+00:00 | 2024-05-11T16:57:23.271429+00:00 | 7 | false | \n\n# Code\n```\nimport java.util.PriorityQueue;\n\nclass Solution {\n\n // Nested class representing a buy order\n public class Buy {\n int price;\n int amount;\n\n public Buy(int p, int a) {\n price = p;\n amount = a;\n }\n }\n\n // Nested class representi... | 0 | 0 | ['Java'] | 0 |
number-of-orders-in-the-backlog | Using Priority Queue | using-priority-queue-by-usernamectrlc-icop | Intuition\n Describe your first thoughts on how to solve this problem. \nImplement two priority queues to manage orders: one for buy orders sorted in descending | usernamectrlc | NORMAL | 2024-04-16T01:07:26.639303+00:00 | 2024-04-16T01:07:26.639323+00:00 | 7 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nImplement two priority queues to manage orders: one for buy orders sorted in descending order and another for sell orders sorted in ascending order. When both buy and sell conditions are satisfied, begin removing the order from the respec... | 0 | 0 | ['Heap (Priority Queue)', 'Kotlin'] | 0 |
number-of-orders-in-the-backlog | two priority queue | two-priority-queue-by-iazinschi2005-rvef | \n# Code\n\nclass Solution {\npublic:\n int getNumberOfBacklogOrders(vector<vector<int>>& orders) {\n priority_queue<pair<int,int>> buyOrders;\n | iazinschi2005 | NORMAL | 2024-03-29T23:13:06.257334+00:00 | 2024-03-29T23:13:06.257394+00:00 | 7 | false | \n# Code\n```\nclass Solution {\npublic:\n int getNumberOfBacklogOrders(vector<vector<int>>& orders) {\n priority_queue<pair<int,int>> buyOrders;\n priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> sellOrders;\n int diff;\n for(auto&x:orders){\n if(x[2]... | 0 | 0 | ['C++'] | 0 |
number-of-orders-in-the-backlog | Java | Priority Queue | java-priority-queue-by-baljitdhanjal-mxfo | \n\n# Code\n\nclass Solution {\n public int getNumberOfBacklogOrders(int[][] orders) {\n PriorityQueue<int[]> maxHeap = new PriorityQueue<>((a, b) -> | baljitdhanjal | NORMAL | 2024-03-18T07:20:20.106542+00:00 | 2024-03-18T07:20:20.106577+00:00 | 15 | false | \n\n# Code\n```\nclass Solution {\n public int getNumberOfBacklogOrders(int[][] orders) {\n PriorityQueue<int[]> maxHeap = new PriorityQueue<>((a, b) -> b[0] - a[0]);\n PriorityQueue<int[]> minHeap = new PriorityQueue<>((a, b) -> a[0] - b[0]);\n long mod = 1000000007;\n int res = 0;\n\n ... | 0 | 0 | ['Java'] | 0 |
number-of-orders-in-the-backlog | 1801. Number of Orders in the Backlog - Beats 86 % | 1801-number-of-orders-in-the-backlog-bea-ie8o | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | jaisalShah | NORMAL | 2024-03-09T06:58:56.659072+00:00 | 2024-03-09T06:58:56.659109+00:00 | 12 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['Heap (Priority Queue)', 'Python3'] | 0 |
number-of-orders-in-the-backlog | Followable Java Code | PriorityQueue | Custom Order class | followable-java-code-priorityqueue-custo-d6x0 | Intuition\nHeapify the input orders. As you add them to your buy and sell prioirty queues, see if you can make a trade. \n\nPS: The Order class basically helps | mehulsri95 | NORMAL | 2024-03-07T01:56:40.052966+00:00 | 2024-03-07T01:56:40.052996+00:00 | 12 | false | # Intuition\nHeapify the input orders. As you add them to your buy and sell prioirty queues, see if you can make a trade. \n\nPS: The Order class basically helps to follow along and avoid messy code (demonstrates a little OOP too :P) \n\n# Approach\nUncomment all Sop\'s to follow along. Hope this helps!\n\n# Code\n```\... | 0 | 0 | ['Heap (Priority Queue)', 'Java'] | 0 |
number-of-orders-in-the-backlog | two heaps | two-heaps-by-maxorgus-e0zp | \n\n# Code\n\nclass Solution:\n def getNumberOfBacklogOrders(self, orders: List[List[int]]) -> int:\n bidbook = []\n askbook = []\n for | MaxOrgus | NORMAL | 2024-02-07T01:33:49.687209+00:00 | 2024-02-07T01:33:49.687231+00:00 | 15 | false | \n\n# Code\n```\nclass Solution:\n def getNumberOfBacklogOrders(self, orders: List[List[int]]) -> int:\n bidbook = []\n askbook = []\n for price,amount,otype in orders:\n if otype == 0:\n while amount and askbook and askbook[0][0]<=price:\n askp,asks ... | 0 | 0 | ['Heap (Priority Queue)', 'Python3'] | 0 |
number-of-orders-in-the-backlog | [Java] ✅ 22ms ✅ 99% ✅ Priority Queue ✅ CLEAN CODE | java-22ms-99-priority-queue-clean-code-b-p95z | Approach\n1. Use 2 queues of type int[]. \n - buyQueue, sorting in descending order of price\n - sellQueue, sorting in ascending order of price\n2. Proces | StefanelStan | NORMAL | 2024-01-23T00:28:18.112235+00:00 | 2024-01-23T00:28:18.112264+00:00 | 66 | false | # Approach\n1. Use 2 queues of type int[]. \n - buyQueue, sorting in descending order of price\n - sellQueue, sorting in ascending order of price\n2. Process each order by type:\n3. BUY, you need to look in sellQueue, \n - loop while order\'s price >= head of queue price. \n - Keep track of what you take ou... | 0 | 0 | ['Java'] | 0 |
number-of-orders-in-the-backlog | C++||clean and explained||using heap | cclean-and-explainedusing-heap-by-mr_err-pj8d | Intuition\nThe intuition behind the provided code lies in its implementation of a basic trading algorithm that handles buy and sell orders efficiently. The algo | mr_Error_404 | NORMAL | 2024-01-14T12:01:04.524226+00:00 | 2024-01-14T12:01:04.524256+00:00 | 9 | false | # Intuition\nThe intuition behind the provided code lies in its implementation of a basic trading algorithm that handles buy and sell orders efficiently. The algorithm uses two priority queues, one for buy orders and one for sell orders, to maintain a sorted order by price. As it iterates through each order in the inpu... | 0 | 0 | ['Heap (Priority Queue)', 'Simulation', 'C++'] | 0 |
number-of-orders-in-the-backlog | 1801. beginner friendly | 1801-beginner-friendly-by-xze1932-6z7r | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | xze1932 | NORMAL | 2024-01-14T05:01:40.351136+00:00 | 2024-01-14T05:01:40.351167+00:00 | 8 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(nlogn)$$\n\n- Space complexity:\n<!-- Add your space complexity here, e.... | 0 | 0 | ['Python'] | 0 |
number-of-orders-in-the-backlog | Java O(NlogN) | java-onlogn-by-tbekpro-c884 | Complexity\n- Time complexity: O(NlogN)\n\n# Code\n\nclass Solution {\n public int getNumberOfBacklogOrders(int[][] orders) {\n PriorityQueue<Order> p | tbekpro | NORMAL | 2024-01-13T15:18:57.648531+00:00 | 2024-01-13T15:18:57.648560+00:00 | 3 | false | # Complexity\n- Time complexity: O(NlogN)\n\n# Code\n```\nclass Solution {\n public int getNumberOfBacklogOrders(int[][] orders) {\n PriorityQueue<Order> pqb = new PriorityQueue<>((a, b) -> b.price - a.price);\n PriorityQueue<Order> pqs = new PriorityQueue<>((a, b) -> a.price - b.price);\n \n ... | 0 | 0 | ['Java'] | 0 |
number-of-orders-in-the-backlog | Java Priority Queue with comments | java-priority-queue-with-comments-by-bru-egav | \nclass Solution {\n public int getNumberOfBacklogOrders(int[][] orders) {\n // create a max heap for buy orders sorted by price\n // When we p | bruce-decker | NORMAL | 2024-01-08T01:58:58.786936+00:00 | 2024-01-08T02:55:10.259706+00:00 | 4 | false | ```\nclass Solution {\n public int getNumberOfBacklogOrders(int[][] orders) {\n // create a max heap for buy orders sorted by price\n // When we peak buy orders, we will get the largest price in buyOrders without removing it\n PriorityQueue<int []> buyOrders = new PriorityQueue<>((a, b) -> b[0] ... | 0 | 0 | ['Java'] | 0 |
number-of-orders-in-the-backlog | [JavaScript] 1801. Number of Orders in the Backlog | javascript-1801-number-of-orders-in-the-pd9lr | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nImplementation logic\n\n\nthere are some orders\n\nan order can buy ( wit | pgmreddy | NORMAL | 2023-12-09T12:06:50.871952+00:00 | 2023-12-09T12:08:33.235846+00:00 | 28 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nImplementation logic\n\n```\nthere are some orders\n\nan order can buy ( with some buy price say 1$, buy count as 10 )\nan order can sell ( with some sell price say 1$, sell count as 10 )\n\nif order says buy\n if someone i... | 0 | 0 | ['JavaScript'] | 0 |
number-of-orders-in-the-backlog | Using Sorted dictionary | using-sorted-dictionary-by-abhinandhukr-2dzu | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | abhinandhukr | NORMAL | 2023-12-06T18:07:47.124041+00:00 | 2023-12-06T18:07:47.124061+00:00 | 6 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 0 | 0 | ['C#'] | 0 |
number-of-orders-in-the-backlog | Easy to understand JavaScript solution (Priority Queue) | easy-to-understand-javascript-solution-p-mt4x | Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(n)\n\n# Code\n\nvar getNumberOfBacklogOrders = function(orders) {\n const MODULO = 10 ** 9 | tzuyi0817 | NORMAL | 2023-11-10T03:03:42.717437+00:00 | 2023-11-10T03:03:42.717458+00:00 | 24 | false | # Complexity\n- Time complexity:\n$$O(nlogn)$$\n\n- Space complexity:\n$$O(n)$$\n\n# Code\n```\nvar getNumberOfBacklogOrders = function(orders) {\n const MODULO = 10 ** 9 + 7;\n const buyQueue = new MaxPriorityQueue({ priority:x => x.price });\n const sellQueue = new MinPriorityQueue({ priority:x => x.price })... | 0 | 0 | ['JavaScript'] | 0 |
number-of-orders-in-the-backlog | [Python3] OOD | Interview Friendly Solution | python3-ood-interview-friendly-solution-wb6w1 | Complexity\nTime: O(nlogn)\nSpace: O(n)\n\n\n# Code\n\nimport abc\nimport heapq\nfrom enum import Enum\nfrom abc import ABC, abstractmethod\nfrom typing import | specbug | NORMAL | 2023-11-08T08:29:38.733937+00:00 | 2023-11-08T08:30:20.565280+00:00 | 20 | false | # Complexity\nTime: $$O(nlogn)$$\nSpace: $$O(n)$$\n\n\n# Code\n```\nimport abc\nimport heapq\nfrom enum import Enum\nfrom abc import ABC, abstractmethod\nfrom typing import Optional, List\n\nMOD = int(1e9+7)\nclass OrderType(Enum):\n BUY = 0\n SELL = 1\n\n @classmethod\n def get(cls, order_type_id: int):\n ... | 0 | 0 | ['Python3'] | 0 |
find-the-array-concatenation-value | Pow and Log | pow-and-log-by-votrubac-8uij | We use pow and log10 to avoid string conversion.\n\n## One-Liner\nOne-liner for my functional frieds. For those who are yet to embrace this, see the raw loops v | votrubac | NORMAL | 2023-02-12T04:32:45.966488+00:00 | 2023-02-12T21:43:57.714525+00:00 | 2,404 | false | We use `pow` and `log10` to avoid string conversion.\n\n## One-Liner\nOne-liner for my functional frieds. For those who are yet to embrace this, see the raw loops version below. \n\n**C++**\n```cpp\nlong long findTheArrayConcVal(vector<int>& n) {\n return transform_reduce(begin(n), begin(n) + n.size() / 2, rbegin(n)... | 46 | 1 | ['C'] | 7 |
find-the-array-concatenation-value | ✅Python3 || C++✅ Beats 100% | python3-c-beats-100-by-abdullayev_akbar-z6ni | \n\n# Please UPVOTE \uD83D\uDE0A\n\n## Python3\n\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n ans=0\n if len(num | abdullayev_akbar | NORMAL | 2023-02-12T04:40:54.328534+00:00 | 2023-03-26T10:15:15.673636+00:00 | 1,829 | false | \n\n# Please UPVOTE \uD83D\uDE0A\n\n## Python3\n```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n ans=0\n if len(nums)%2==1:\n ans=nums[len(nums)//2]... | 27 | 1 | ['Python3'] | 5 |
find-the-array-concatenation-value | ✅🚀 c++ very easy two pointer approach✅🚀 | c-very-easy-two-pointer-approach-by-sura-ngs6 | \n# Code\n\nclass Solution {\npublic:\n/* simple two pointer approach --> T.C : O(N)\n\nalgo:\n\n1. Take first and last element from array.\n2. convert them int | suraj_jha989 | NORMAL | 2023-02-12T04:03:26.447017+00:00 | 2023-02-12T04:54:09.352981+00:00 | 1,386 | false | \n# Code\n```\nclass Solution {\npublic:\n/* simple two pointer approach --> T.C : O(N)\n\nalgo:\n\n1. Take first and last element from array.\n2. convert them into string and concatenate them.\n3. add result to answer\n4. do this until all elements are traversed.\n*/\n long long findTheArrayConcVal(vector<int>& num... | 17 | 0 | ['C++'] | 3 |
find-the-array-concatenation-value | 🔥🔥 Simple C++ || to_string() function | simple-c-to_string-function-by-atharva_k-tssn | \nclass Solution {\npublic:\n #define ll long long\n long long findTheArrayConcVal(vector<int>& nums) \n {\n ll res = 0;\n int low = 0;\n | atharva_kulkarni1 | NORMAL | 2023-02-12T04:17:25.323215+00:00 | 2023-02-12T04:21:17.189917+00:00 | 993 | false | ```\nclass Solution {\npublic:\n #define ll long long\n long long findTheArrayConcVal(vector<int>& nums) \n {\n ll res = 0;\n int low = 0;\n int high = nums.size()-1;\n \n while(low < high)\n {\n string temp = to_string(nums[low]) + to_string(nums[high]);\n ... | 13 | 1 | ['String', 'C', 'C++'] | 0 |
find-the-array-concatenation-value | Simple java solution | simple-java-solution-by-siddhant_1602-wcoo | \n\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n | Siddhant_1602 | NORMAL | 2023-02-12T04:00:52.573681+00:00 | 2023-02-12T04:03:18.243242+00:00 | 2,091 | false | \n\n# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n long m=0;\n if(nums.length==1)\n {\n return (long)(nums[0]);\n }\n for(int i=0,j=nums.length-1;i<j;i++,j--)\n ... | 12 | 0 | ['Java'] | 3 |
find-the-array-concatenation-value | Python 3 || 5 lines, iteration || T/S: 86% / 72% | python-3-5-lines-iteration-ts-86-72-by-s-3jkk | \nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n\n n=len(nums)\n\n ans=nums[n//2] if n%2 else 0\n\n for i in | Spaulding_ | NORMAL | 2023-02-12T08:12:24.464758+00:00 | 2024-06-21T16:50:53.695488+00:00 | 795 | false | ```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n\n n=len(nums)\n\n ans=nums[n//2] if n%2 else 0\n\n for i in range(n//2): \n ans += int(str(nums[i])+str(nums[-i-1]))\n \n return ans\n```\n[https://leetcode.com/problems/find-the-array-concat... | 9 | 0 | ['Python3'] | 0 |
find-the-array-concatenation-value | Concatenate String ✅ || Easy Understanding ✅ | concatenate-string-easy-understanding-by-qu80 | Hi,\n\nWe have to iterate through the loop and add to result.\n\nKindly upvote if its helpful.\n```\n public long findTheArrayConcVal(int[] nums) {\n | Surendaar | NORMAL | 2023-02-12T04:04:02.986284+00:00 | 2023-02-12T07:05:57.581535+00:00 | 667 | false | Hi,\n\nWe have to iterate through the loop and add to result.\n\nKindly upvote if its helpful.\n```\n public long findTheArrayConcVal(int[] nums) {\n long res=0;\n for(int i=0; i<(nums.length/2); i++){\n \tString tmp = nums[i]+""+nums[nums.length-1-i];\n \tres = res + Integer.parseInt(tmp... | 9 | 0 | ['String', 'Java'] | 1 |
find-the-array-concatenation-value | Python | 100% Faster | Easy Solution✅ | python-100-faster-easy-solution-by-gmana-6yxf | Code\u2705\n\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n concatenation = 0\n while len(nums)>0:\n if | gmanayath | NORMAL | 2023-02-12T15:54:51.305845+00:00 | 2023-02-12T15:58:40.813907+00:00 | 1,219 | false | # Code\u2705\n```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n concatenation = 0\n while len(nums)>0:\n if len(nums)>1:\n concatenation += int(str(nums[0])+str(nums[-1]))\n del nums[-1]\n else:\n concatena... | 8 | 0 | ['Python', 'Python3'] | 0 |
find-the-array-concatenation-value | ✅ very fast C++ | with explanation | very-fast-c-with-explanation-by-coding_m-dxsv | Thought process\n\nFirst: We need to concantenate every integer with it\'s corresponding integer at the same position it is from the other end.\nFor eg, in [23, | coding_menance | NORMAL | 2023-02-12T07:18:40.890262+00:00 | 2023-02-12T17:51:11.832407+00:00 | 506 | false | # Thought process\n\n**First:** We need to concantenate every integer with it\'s corresponding integer at the same position it is from the other end.\nFor eg, in **[23, 54, 65, 24, 87]** we need to concantanate *23 & 87* to get **2387** and then *54 & 24* to get **5424**. Since this list contains odd number of element... | 8 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Very Simple & Easy to Understand Solution | very-simple-easy-to-understand-solution-2ckkl | \n# Code\n\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n long long ans = 0;\n int n = nums.size();\n | kreakEmp | NORMAL | 2023-02-12T04:15:09.045044+00:00 | 2023-02-12T04:15:09.045085+00:00 | 2,381 | false | \n# Code\n```\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n long long ans = 0;\n int n = nums.size();\n for(int i = 0; i < n/2; ++i){\n string t = to_string(nums[i]) + to_string(nums[n - i - 1]);\n ans += stol(t);\n }\n if(... | 8 | 0 | ['C++'] | 2 |
find-the-array-concatenation-value | PYTHON || Very Simple and Easy to Understand Code in Python 🌟✅ | python-very-simple-and-easy-to-understan-z0jk | \n# Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \n O(n) \n\n# Code\n\nclass Solution:\n def findTheArrayConcVal(self, nums: | DeepakNishad | NORMAL | 2023-02-12T04:35:48.451381+00:00 | 2023-02-12T04:36:00.983575+00:00 | 626 | false | \n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n O(n) \n\n# Code\n```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n i=0\n j=len(nums)-1\n res=0\n while i<=j:\n if i==j: \n res+=int(... | 7 | 0 | ['Two Pointers', 'Python3'] | 3 |
find-the-array-concatenation-value | C++ | Easy Solution | c-easy-solution-by-iam_invincible-9cwc | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | iam_invincible | NORMAL | 2023-02-12T04:08:53.831657+00:00 | 2023-02-12T04:08:53.831698+00:00 | 193 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 6 | 0 | ['Two Pointers', 'C++'] | 1 |
find-the-array-concatenation-value | Java || Two Pointers || CF | java-two-pointers-cf-by-mmohmedjasim2005-ayxl | ApproachWe use a two-pointer technique (with pointers l and r) to compute the concatenation value of an array efficientlyInitialization:The left pointer (l) is | mmohmedjasim2005 | NORMAL | 2025-01-23T15:23:04.630844+00:00 | 2025-01-23T15:23:04.630844+00:00 | 223 | false | # Approach
**We use a two-pointer technique (with pointers l and r) to compute the concatenation value of an array efficiently**
## Initialization:
The left pointer (l) is initialized to the start of the array (0), and the right pointer (r) is initialized to the end of the array (nums.length - 1)
A variable con is ... | 5 | 0 | ['Java'] | 1 |
find-the-array-concatenation-value | Java || 2 Solution❤️❤️ || StringBuilder || 2 Pointer || Easy Solution|| | java-2-solution-stringbuilder-2-pointer-4440h | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | saurabh_kumar1 | NORMAL | 2023-08-29T20:05:49.700965+00:00 | 2023-08-29T20:05:49.700983+00:00 | 319 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:0(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:0(1)\n<!-- Add your space complexity here, e.g. $$O... | 5 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | C++ | Easy Approach | 4 Lines of Code | c-easy-approach-4-lines-of-code-by-_hori-hh0z | \n# Approach\n Describe your approach to solving the problem. \nUsing to_string and stoi\n\n\n# Code\n\nclass Solution {\npublic:\n long long findTheArrayCon | _horiZon_OP | NORMAL | 2023-02-12T04:56:17.889123+00:00 | 2023-02-12T04:57:05.797890+00:00 | 246 | false | \n# Approach\n<!-- Describe your approach to solving the problem. -->\nUsing `to_string` and `stoi`\n\n\n# Code\n```\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n long long n = size(nums), i = 0, j = n-1,ans = 0;\n while(i<j) ans += stoi((to_string(nums[i++])+to_st... | 5 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | BEGINNER FRIENDLY PYTHON PROGRAM [ BEATS 88% OF USERS ] | beginner-friendly-python-program-beats-8-gdzz | Intuition\nUsing for loop and string slicing\n\n# Approach\n Describe your approach to solving the problem. \nwe use for loop to iterate over the list and take | chorko_c | NORMAL | 2023-10-31T05:33:38.124878+00:00 | 2023-10-31T05:33:38.124908+00:00 | 102 | false | # Intuition\nUsing for loop and string slicing\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nwe use for loop to iterate over the list and take the 1st and last elements as string and concatenate\n\n# Code\n```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n ... | 4 | 0 | ['Python3'] | 0 |
find-the-array-concatenation-value | C++ || EASY TO UNDERSTAND | c-easy-to-understand-by-ganeshkumawat874-jjyq | Code\n\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n int i = 0,j=nums.size()-1,x,y;\n long long int ans=0;\ | ganeshkumawat8740 | NORMAL | 2023-05-15T12:12:34.580862+00:00 | 2023-05-15T12:12:34.580910+00:00 | 744 | false | # Code\n```\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n int i = 0,j=nums.size()-1,x,y;\n long long int ans=0;\n while(i<j){\n x = nums[j];\n y = 0;\n while(x){\n y++;\n x /= 10;\n }\n ... | 4 | 0 | ['Array', 'Two Pointers', 'Simulation', 'C++'] | 0 |
find-the-array-concatenation-value | Easy to understand Sol for beginners | easy-to-understand-sol-for-beginners-by-jf3ay | Intuition\n Describe your first thoughts on how to solve this problem. \n1. to_string function to convert the integer to string for concatenation.\n2. stoi() to | Adit_14 | NORMAL | 2023-03-17T16:20:01.966818+00:00 | 2023-03-17T16:20:01.966862+00:00 | 897 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n1. to_string function to convert the integer to string for concatenation.\n2. stoi() to convert string back into integer.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Iterating over the first half of the nums... | 4 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Java | 8 lines | Simple and clean code | Beats 100% | java-8-lines-simple-and-clean-code-beats-ycti | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | judgementdey | NORMAL | 2023-02-12T16:52:36.150245+00:00 | 2023-02-13T00:47:10.954563+00:00 | 134 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here... | 4 | 0 | ['Java'] | 1 |
find-the-array-concatenation-value | JavaScript short and sweet | javascript-short-and-sweet-by-ramrad-adhy | js\nconst findTheArrayConcVal = nums => {\n let output = 0;\n let i = 0;\n let j = nums.length - 1;\n\n while (i <= j) {\n output += Number(i === j ? num | ramrad | NORMAL | 2023-02-12T14:56:28.490664+00:00 | 2023-02-12T14:56:28.490694+00:00 | 371 | false | ```js\nconst findTheArrayConcVal = nums => {\n let output = 0;\n let i = 0;\n let j = nums.length - 1;\n\n while (i <= j) {\n output += Number(i === j ? nums[i] : `${nums[i]}` + `${nums[j]}`);\n i++;\n j--;\n }\n return output;\n};\n``` | 4 | 0 | ['JavaScript'] | 0 |
find-the-array-concatenation-value | Using lambda function,to_string and stoll | using-lambda-functionto_string-and-stoll-ickw | Complexity\n- Time complexity:\nO(n/2)\n\n- Space complexity:\nO(1)\n\n# Code\n\nclass Solution {\npublic:\n typedef long long ll;\n long long findTheArra | harsh_patell21 | NORMAL | 2023-02-12T08:26:58.253377+00:00 | 2023-02-12T08:26:58.253410+00:00 | 40 | false | # Complexity\n- Time complexity:\n$$O(n/2)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n typedef long long ll;\n long long findTheArrayConcVal(vector<int>& nums) {\n ll n=nums.size();\n ll total=0;\n for(int i=0;i<n/2;i++){\n [&total](int a,int b){t... | 4 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | ✅C# || ✅JAVA || 🐍Python || Easy to Understand || ⏳Beats 100% | c-java-python-easy-to-understand-beats-1-zt3c | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | santhosh1608 | NORMAL | 2023-02-12T06:05:06.548134+00:00 | 2023-02-12T06:05:06.548187+00:00 | 529 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 4 | 0 | ['C#'] | 0 |
find-the-array-concatenation-value | EASY TO UNDERSTAND C++ || POW AND LOG || TWO POINTERS | easy-to-understand-c-pow-and-log-two-poi-vxax | \nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n long long int ans=0,x,b;\n int i = 0, j = nums.size()-1;\n | yash___sharma_ | NORMAL | 2023-02-12T05:48:32.875367+00:00 | 2023-02-12T05:48:32.875410+00:00 | 175 | false | ```\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n long long int ans=0,x,b;\n int i = 0, j = nums.size()-1;\n while(i<j){\n x = nums[j], b = 0;\n while(x){\n b++;\n x /= 10;\n }\n ans = a... | 4 | 0 | ['Array', 'Two Pointers', 'C', 'C++'] | 0 |
find-the-array-concatenation-value | Two pointer easy | two-pointer-easy-by-feistyfawn-tgvr | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | feistyfawn | NORMAL | 2023-02-12T05:19:01.971335+00:00 | 2023-02-12T13:47:24.731952+00:00 | 416 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 4 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | ✅C++ || EASY && CLEAN && StraightForward CODE | c-easy-clean-straightforward-code-by-abh-y8b3 | \n\nT->O(n/2) && S->O(1)\n\n\tclass Solution {\n\tpublic:\n\t\tlong long findTheArrayConcVal(vector& nums) {\n\t\t\tint n = nums.size();\n\t\t\tint i = 0,j = n- | abhinav_0107 | NORMAL | 2023-02-12T04:22:21.882012+00:00 | 2023-02-12T04:22:40.579618+00:00 | 746 | false | \n\n**T->O(n/2) && S->O(1)**\n\n\tclass Solution {\n\tpublic:\n\t\tlong long findTheArrayConcVal(vector<int>& nums) {\n\t\t\tint n = nums.size();\n\t\t\tint i = 0,j = n-1;\n\t\t\tlong long ans = 0;\n\n\t\t\twhil... | 4 | 0 | ['Two Pointers', 'C', 'C++'] | 0 |
find-the-array-concatenation-value | Two pointers Python 3 solution | two-pointers-python-3-solution-by-artyom-vf8d | \n\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n result = 0\n\n p1 = 0\n p2 = len(nums) - 1\n\n whi | artyom02 | NORMAL | 2023-06-06T21:19:27.147666+00:00 | 2023-06-06T21:19:27.147724+00:00 | 58 | false | \n```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n result = 0\n\n p1 = 0\n p2 = len(nums) - 1\n\n while p1 <= p2:\n if p1 == p2:\n result += int(nums[p1])\n\n else:\n result += int(str(nums[p1]) + str(nums[... | 3 | 0 | ['Two Pointers', 'Python3'] | 1 |
find-the-array-concatenation-value | Easy Python Solution using 2 pointers | easy-python-solution-using-2-pointers-by-gbh1 | \n\n# Code\n\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n left=0\n right=len(nums)-1\n total=0\n w | vistrit | NORMAL | 2023-02-17T20:10:50.412642+00:00 | 2023-02-17T20:10:50.412675+00:00 | 490 | false | \n\n# Code\n```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n left=0\n right=len(nums)-1\n total=0\n while left<=right:\n if left<right:\n total+=int(str(nums[left])+str(nums[right]))\n else:\n total+=nums[l... | 3 | 0 | ['Python3'] | 0 |
find-the-array-concatenation-value | C++ easy to understand solution | c-easy-to-understand-solution-by-sahilla-tlwd | Intuition :\nMoving towards middle from extreme ends.\n Describe your first thoughts on how to solve this problem. \n\n# Approach :\nTaking pointer to start and | sahillather002 | NORMAL | 2023-02-16T16:25:53.226425+00:00 | 2023-02-16T16:25:53.226465+00:00 | 1,233 | false | # Intuition :\nMoving towards middle from extreme ends.\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach :\nTaking pointer to start and end , traversing towards each other at constant rate. Applying formula at each iteration to get final result.\n<!-- Describe your approach to solving ... | 3 | 0 | ['Array', 'Two Pointers', 'C++'] | 0 |
find-the-array-concatenation-value | ✅C++ beats 100% of submissions ✅ | c-beats-100-of-submissions-by-akshay_ar_-6azk | Intuition\n Describe your first thoughts on how to solve this problem. \n- Just by looking at the word "concatenation", I had got the string approach in my mind | akshay_AR_2002 | NORMAL | 2023-02-12T17:01:11.759622+00:00 | 2023-02-12T17:01:11.759654+00:00 | 265 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n- Just by looking at the word "concatenation", I had got the string approach in my mind along with its predefined functions.. stoi(used for the conversion of string to integer) and to_string(converts integer value to string).\n\n# Approac... | 3 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Easy Solution | Faster using Two Pointers and Strings 3ms | easy-solution-faster-using-two-pointers-drzj3 | Intuition\n1. We need first element & last element from array -> so we will use Two Pointer to solve.\n2. We need to Concate these two elements from array -> so | harshadnavsar | NORMAL | 2023-02-12T07:33:46.486528+00:00 | 2023-02-12T07:33:46.486555+00:00 | 249 | false | # Intuition\n1. We need first element & last element from array -> so we will use Two Pointer to solve.\n2. We need to Concate these two elements from array -> so we will use Strings.\n3. And then we need to process the ans. \n\n# Approach\nWe will get both elements from pointers (low,high) and then convert them into S... | 3 | 0 | ['Two Pointers', 'String', 'Java'] | 0 |
find-the-array-concatenation-value | Find the Array Concatenation Value || Python || Easy Solution || 2 Approaches || Beats 100 % | find-the-array-concatenation-value-pytho-24k4 | Step-by-Step Explanation - Code 11. Initialize variables
n = len(nums) gets the length of the input array nums.
concatenation_value = 0 initializes a variable t | aishvgandhi | NORMAL | 2025-01-26T09:56:52.105555+00:00 | 2025-01-26T09:56:52.105555+00:00 | 53 | false | # **Step-by-Step Explanation - Code 1**
## 1. **Initialize variables**
- `n = len(nums)` gets the length of the input array `nums`.
- `concatenation_value = 0` initializes a variable to accumulate the result.
## 2. **Loop through half of the array**
```python
for i in range(n // 2):
```
- The loop r... | 2 | 0 | ['Array', 'Two Pointers', 'Simulation', 'Python3'] | 0 |
find-the-array-concatenation-value | to_string() ans stoi() jindabad ! :D handle size even odd utna hee bas :D | to_string-ans-stoi-jindabad-d-handle-siz-2c1w | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | yesyesem | NORMAL | 2024-08-30T18:35:28.342275+00:00 | 2024-08-30T18:35:28.342348+00:00 | 20 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 2 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Easy Java Solution || Beginner Friendly || String Builder | easy-java-solution-beginner-friendly-str-a89h | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | anikets101 | NORMAL | 2024-04-21T14:20:52.457952+00:00 | 2024-04-21T14:20:52.457986+00:00 | 31 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 2 | 0 | ['Java'] | 1 |
find-the-array-concatenation-value | Dart code | dart-code-by-4khil_raj-b4bm | \n\nclass Solution {\n int findTheArrayConcVal(List<int> nums) {\n int sum=0;\n int i=0;\n int j=nums.length-1;\n if(nums.length==1){\n | 4khil_Raj | NORMAL | 2024-01-03T06:17:19.820470+00:00 | 2024-01-03T06:17:19.820502+00:00 | 26 | false | \n```\nclass Solution {\n int findTheArrayConcVal(List<int> nums) {\n int sum=0;\n int i=0;\n int j=nums.length-1;\n if(nums.length==1){\n return nums[0];\n }else{\n while(i<j){\n var num1=nums[i].toString();\n var nums2=nums[j].toString();\n int result=int.parse(... | 2 | 0 | ['Dart'] | 0 |
find-the-array-concatenation-value | BEATS 100% | 2 PTR | EASY | EXPLAINED | beats-100-2-ptr-easy-explained-by-smt26-c276 | \n\n# Intuition\n Describe your first thoughts on how to solve this problem. \nThe intuition is simply to directly take two pointers and start concatnating the | SMT26 | NORMAL | 2023-12-21T13:26:29.784167+00:00 | 2023-12-21T13:26:29.784197+00:00 | 23 | false | \n\n# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe intuition is simply to directly take two pointers and start concatnating the numbers.\n\n# Approach\n<!-- Describe yo... | 2 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | ❇ find-array-concatenation👌 🏆O(N)❤️ Javascript❤️ Memory👀95.45%🕕 Meaningful Vars✍️ 🔴🔥 ✅ 👉 💪🙏 | find-array-concatenation-on-javascript-m-awy1 | Time Complexity: O(N)\nSpace Complexity: O(1)\n\nvar findTheArrayConcVal = function(nums) {\n let store = 0;\n if (nums.length % 2 === 0) {\n for ( | anurag-sindhu | NORMAL | 2023-09-11T02:42:07.014287+00:00 | 2023-09-11T02:42:07.014318+00:00 | 256 | false | Time Complexity: O(N)\nSpace Complexity: O(1)\n```\nvar findTheArrayConcVal = function(nums) {\n let store = 0;\n if (nums.length % 2 === 0) {\n for (let index = 0; index < nums.length / 2; index++) {\n store += parseInt(`${nums[index]}${nums[nums.length - index - 1]}`);\n }\n } else {... | 2 | 0 | ['JavaScript'] | 0 |
find-the-array-concatenation-value | Easy Python solution ||runtime 96.19% | easy-python-solution-runtime-9619-by-lal-awd9 | \n\n# Code\n\nclass Solution(object):\n def findTheArrayConcVal(self, nums):\n """\n :type nums: List[int]\n :rtype: int\n """\n | Lalithkiran | NORMAL | 2023-03-17T13:51:36.632232+00:00 | 2023-03-17T13:51:36.632267+00:00 | 110 | false | \n\n# Code\n```\nclass Solution(object):\n def findTheArrayConcVal(self, nums):\n """\n :type nums: List[int]\n :rtype: int\n """\n sm=0\n i=0\n j=len(num... | 2 | 0 | ['Array', 'Two Pointers', 'Simulation', 'Python'] | 0 |
find-the-array-concatenation-value | Easy Java Solution | easy-java-solution-by-agdarshit19-oxmd | \n\n# Code\n\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n long sum = 0;\n int i = 0;\n int j = nums.length - 1;\n | agdarshit19 | NORMAL | 2023-03-15T10:22:08.667020+00:00 | 2023-03-15T10:22:08.667068+00:00 | 688 | false | \n\n# Code\n```\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n long sum = 0;\n int i = 0;\n int j = nums.length - 1;\n while(i <= j)\n {\n String s = Long.toString(nums[i]);\n String st = Long.toString(nums[j]);\n s = s + st;\n ... | 2 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | Efficiently Concatenating and Summing Integers in JavaScript with two Approaches | efficiently-concatenating-and-summing-in-5yd2 | \n# Algorithm 1: Using String Conversion\n\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar findTheArrayConcVal = function(nums) {\n let ans = | astiksarathe | NORMAL | 2023-02-24T06:23:18.107343+00:00 | 2023-02-24T06:23:18.107382+00:00 | 211 | false | \n# Algorithm 1: Using String Conversion\n```\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar findTheArrayConcVal = function(nums) {\n let ans = 0;\n let left = 0, right = nums.length-1;\n while(left <= right){\n if(left !== right){\n let n = countDigits(nums[left]);\n ... | 2 | 0 | ['Two Pointers', 'TypeScript', 'JavaScript'] | 1 |
find-the-array-concatenation-value | Java 100% faster solution | java-100-faster-solution-by-avadarshverm-s0jh | \n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity: O(N)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O | avadarshverma737 | NORMAL | 2023-02-14T05:28:42.339080+00:00 | 2023-02-14T05:28:42.339131+00:00 | 638 | false | \n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n public long findTheArrayConcVal(int[] nums) ... | 2 | 0 | ['String', 'Bit Manipulation', 'Java'] | 0 |
find-the-array-concatenation-value | Simple and easy Array | simple-and-easy-array-by-ayesha__19-rlf4 | \nclass Solution\n{\npublic:\n int concat(int a, int b)\n {\n string s1 = to_string(a);\n string s2 = to_string(b);\n string s = s1 + | ayesha__19__ | NORMAL | 2023-02-12T09:54:28.050439+00:00 | 2023-02-12T09:54:28.050478+00:00 | 26 | false | ```\nclass Solution\n{\npublic:\n int concat(int a, int b)\n {\n string s1 = to_string(a);\n string s2 = to_string(b);\n string s = s1 + s2;\n int c = stoi(s);\n return c;\n }\n long long findTheArrayConcVal(vector<int> &nums)\n {\n long long ans = 0;\n in... | 2 | 0 | ['Array', 'Two Pointers', 'C++'] | 0 |
find-the-array-concatenation-value | CPP | Easy solution with string conversion | cpp-easy-solution-with-string-conversion-fnvx | \nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n int n=nums.size();double ans=0;\n for(int i=0;i<n/2;i++){\n | sanketkadam143 | NORMAL | 2023-02-12T06:41:52.069407+00:00 | 2023-02-12T06:41:52.069441+00:00 | 229 | false | ```\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n int n=nums.size();double ans=0;\n for(int i=0;i<n/2;i++){\n string res="";\n res+=to_string(nums[i])+to_string(nums[n-i-1]);\n ans+=stoi(res); \n }\n if(n % 2 == 1){\n ... | 2 | 0 | ['String'] | 2 |
find-the-array-concatenation-value | Java | easy to understand | java-easy-to-understand-by-venkat089-jqed | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Venkat089 | NORMAL | 2023-02-12T04:05:00.056847+00:00 | 2023-02-12T04:05:00.056885+00:00 | 544 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 2 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | Python Solution easy to understand || super easy solution | python-solution-easy-to-understand-super-3sdw | \nclass Solution:\n def findTheArrayConcVal(self, num: List[int]) -> int:\n\t\t# to store final sum\n ans = 0\n\t\t# traverse the num array untill its | mohitsatija | NORMAL | 2023-02-12T04:04:14.443096+00:00 | 2023-02-12T04:04:14.443148+00:00 | 205 | false | ```\nclass Solution:\n def findTheArrayConcVal(self, num: List[int]) -> int:\n\t\t# to store final sum\n ans = 0\n\t\t# traverse the num array untill its empty\n while num:\n\t\t\t# pop the first element out convert it to string\n p = str(num.pop(0))\n q = ""\n\t\t\t\n\t\t\t# if a... | 2 | 0 | ['Python', 'Python3'] | 0 |
find-the-array-concatenation-value | Easy Solution in java| O(N) time | easy-solution-in-java-on-time-by-utkarsh-qysq | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Utkarsh172 | NORMAL | 2023-02-12T04:03:39.758530+00:00 | 2023-02-12T04:04:41.839643+00:00 | 82 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$... | 2 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | [Java] Simple two pointers solution | java-simple-two-pointers-solution-by-0x4-qptd | Intuition\n Describe your first thoughts on how to solve this problem. \nJust follow the steps in the problem.\n\n# Approach\n Describe your approach to solving | 0x4c0de | NORMAL | 2023-02-12T04:03:09.216289+00:00 | 2023-02-12T04:03:49.985378+00:00 | 355 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nJust follow the steps in the problem.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nUse two pointers to mark the first and last number.\n\n# Complexity\n- Time complexity: $$O(N)$$\n<!-- Add your time complexity ... | 2 | 0 | ['Two Pointers', 'Java'] | 0 |
find-the-array-concatenation-value | leetcodedaybyday - Beats 100% with C++ and Beats 100% with Python3 and Beats 28.62% with Java | leetcodedaybyday-beats-100-with-c-and-be-iibg | IntuitionWe need to compute the "concatenation value" of an array by pairing numbers from both ends and concatenating them as strings before summing their numer | tuanlong1106 | NORMAL | 2025-02-22T08:46:17.121896+00:00 | 2025-02-22T08:46:17.121896+00:00 | 90 | false | # Intuition
We need to compute the "concatenation value" of an array by pairing numbers from both ends and concatenating them as strings before summing their numeric values.
# Approach
1. **Two-pointer technique**:
- Use two pointers (`left` and `right`), where `left` starts from the beginning and `right` starts ... | 1 | 0 | ['Array', 'Two Pointers', 'Simulation', 'C++', 'Java', 'Python3'] | 0 |
find-the-array-concatenation-value | C++ 100% two indexes | c-100-two-indexes-by-michelusa-i5ya | Approach\nUse left and right indexes to iterate thtough nums.\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\ncpp []\nclass So | michelusa | NORMAL | 2024-11-28T15:43:58.337102+00:00 | 2024-11-28T15:43:58.337149+00:00 | 39 | false | # Approach\nUse left and right indexes to iterate thtough nums.\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```cpp []\nclass Solution {\npublic:\n long long findTheArrayConcVal(const vector<int>& nums) const {\n if (nums.size() == 1) {\n return nums.fro... | 1 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Easy solution with step by step | easy-solution-with-step-by-step-by-shamn-adif | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | shamnad_skr | NORMAL | 2024-11-15T19:22:27.613857+00:00 | 2024-11-15T19:22:27.613880+00:00 | 39 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 1 | 0 | ['TypeScript', 'JavaScript'] | 1 |
find-the-array-concatenation-value | Easy and direct solution... | easy-and-direct-solution-by-manyaagargg-zem9 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | manyaagargg | NORMAL | 2024-07-30T15:59:04.302444+00:00 | 2024-07-30T15:59:04.302481+00:00 | 2 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 1 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | SIMPLE TWO-POINTER C++ SOLUTION | simple-two-pointer-c-solution-by-jeffrin-56u2 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Jeffrin2005 | NORMAL | 2024-07-20T13:10:33.562923+00:00 | 2024-07-20T13:10:33.562955+00:00 | 23 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:o(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(1)\n<!-- Add your space complexity here, e.g. $$O... | 1 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Two Pointer || 83% T.C || 67% S.C || CPP | two-pointer-83-tc-67-sc-cpp-by-ganesh_ag-zo9x | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Ganesh_ag10 | NORMAL | 2024-04-22T14:24:26.185257+00:00 | 2024-04-22T14:24:26.185283+00:00 | 34 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 1 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | ✅ Laconic Two Pointers | laconic-two-pointers-by-eleev-5tyo | \n\n# Solution\nswift\nstruct Solution {\n @_optimize(speed)\n consuming func findTheArrayConcVal(_ nums: [Int]) -> Int {\n let n = nums.count\n | eleev | NORMAL | 2024-03-28T06:23:55.243357+00:00 | 2024-03-28T06:25:39.013853+00:00 | 2 | false | \n\n# Solution\n```swift\nstruct Solution {\n @_optimize(speed)\n consuming func findTheArrayConcVal(_ nums: [Int]) -> Int {\n let n = nums.count\n var concat = 0\n\n for lef... | 1 | 0 | ['Array', 'Two Pointers', 'Swift', 'Simulation'] | 0 |
find-the-array-concatenation-value | Simple Java Solution 💡 | simple-java-solution-by-keerthivarmank-a8vi | Intuition\n\nThe provided Java function findTheArrayConcVal aims to calculate the concatenation value of an array of integers. The concatenation value is obtain | KeerthiVarmanK | NORMAL | 2024-02-12T14:38:20.494764+00:00 | 2024-02-12T14:38:20.494792+00:00 | 51 | false | # Intuition\n\nThe provided Java function findTheArrayConcVal aims to calculate the concatenation value of an array of integers. The concatenation value is obtained by concatenating each pair of integers from the array, where the integers are taken alternately from the beginning and end of the array.\n\n# Approach\n\n1... | 1 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | Simple solution | simple-solution-by-muhmdshanoob-z811 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | muhmdshanoob | NORMAL | 2024-01-03T05:42:59.934187+00:00 | 2024-01-03T05:42:59.934260+00:00 | 111 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 1 | 0 | ['JavaScript'] | 0 |
find-the-array-concatenation-value | Java .. Simple Approach | java-simple-approach-by-anoopchaudhary1-glcb | Code\n\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n List<String> list = new ArrayList<>();\n int l = 0;\n int r= | Anoopchaudhary1 | NORMAL | 2023-12-11T05:48:14.672543+00:00 | 2023-12-11T05:48:14.672576+00:00 | 31 | false | # Code\n```\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n List<String> list = new ArrayList<>();\n int l = 0;\n int r= nums.length-1;\n while(l<=r){\n if(l != r){\n list.add(nums[l]+""+nums[r]+"");\n l++;\n r--;\n ... | 1 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | java 1 ms | java-1-ms-by-susahin80-goic | Consider 12 and 123 as pair, for this pair we first find the length of the second num 123 as 3. Math.pow(10, 3) => gives 1000.\nWe multiply this 1000 with the f | susahin80 | NORMAL | 2023-11-15T11:47:18.808025+00:00 | 2023-11-15T11:47:18.808044+00:00 | 28 | false | Consider 12 and 123 as pair, for this pair we first find the length of the second num 123 as 3. Math.pow(10, 3) => gives 1000.\nWe multiply this 1000 with the first num 12 and get 12000 and as last step we add second num to this, giving 12123. We apply this logic in loop.\n\n# Complexity\n- Time complexity:\nO(n)\n\n- ... | 1 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | ✅ Two-liner, 23ms Beats 100.00% | two-liner-23ms-beats-10000-by-swifterswi-scgl | Solution 1 \u2014 Two-liner\n\n24ms Beats 94.44%\n\nswift\nfunc findTheArrayConcVal(_ nums: [Int], _ i: Int = 0) -> Int {\n guard i != nums.count / 2 else { | swifterswifty | NORMAL | 2023-10-27T14:14:08.522503+00:00 | 2023-10-27T14:33:25.475154+00:00 | 49 | false | # Solution 1 \u2014 Two-liner\n\n24ms Beats 94.44%\n\n```swift\nfunc findTheArrayConcVal(_ nums: [Int], _ i: Int = 0) -> Int {\n guard i != nums.count / 2 else { return nums.count % 2 == 0 ? 0 : nums[i] }\n return Int(String(nums[i]) + String(nums[nums.count - 1 - i]))! + findTheArrayConcVal(nums, i + 1)\n}\n```\... | 1 | 0 | ['Recursion', 'Swift'] | 1 |
find-the-array-concatenation-value | Simple + Understandable; | simple-understandable-by-rohit_pawar-wrns | \n# Code\n\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n vector<string> s;\n int sz = nums.size();\n | rohit_pawar | NORMAL | 2023-08-15T16:31:24.101061+00:00 | 2023-08-15T16:31:24.101091+00:00 | 7 | false | \n# Code\n```\nclass Solution {\npublic:\n long long findTheArrayConcVal(vector<int>& nums) {\n vector<string> s;\n int sz = nums.size();\n if(sz%2==0)sz=sz/2;\n else sz = (sz/2)+1;\n for(int i = 0; i < sz; i++){\n if(nums.size()==1)s.push_back(to_string(nums[0]));\n ... | 1 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Java 0ms beats 100% | java-0ms-beats-100-by-texastim-7rd2 | \n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n\n | texastim | NORMAL | 2023-08-03T22:16:30.751216+00:00 | 2023-08-03T22:17:14.901373+00:00 | 15 | false | \n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n```\nclass Solution {\n public long findTheArrayConcVal(int[] nums) {\n\n long sum = 0; // what we\'ll return\n int idxLeft = 0;\n int idxRight = nums.length - 1;\n\n while (idxLeft < idxRight) {\n ... | 1 | 0 | ['Java'] | 0 |
find-the-array-concatenation-value | Array Concatenation Value | array-concatenation-value-by-shaunak5432-utvm | Approach\n Describe your approach to solving the problem. \nWe need to iterate on the list from the start and reverse from the end. We will only interate half o | Shaunak54323 | NORMAL | 2023-04-10T14:28:13.595830+00:00 | 2023-04-10T18:49:12.804132+00:00 | 20 | false | # Approach\n<!-- Describe your approach to solving the problem. -->\nWe need to iterate on the list from the start and reverse from the end. We will only interate half of the loop. Then we will concatinate ```i```th and ```n - i - 1```th element by converting it into string, adding it and again converting it to the int... | 1 | 0 | ['Dynamic Programming', 'Python3'] | 0 |
find-the-array-concatenation-value | Two pointer --> Beginner friendly C++ code | two-pointer-beginner-friendly-c-code-by-w68fb | Intuition\n Describe your first thoughts on how to solve this problem. \nTwo pointer concept need is needed to be used. Keep pointer \'i\' in the begining and \ | sunny_6289 | NORMAL | 2023-04-09T09:09:22.562550+00:00 | 2023-04-09T09:09:22.562586+00:00 | 29 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTwo pointer concept need is needed to be used. Keep pointer \'i\' in the begining and \'j\' in the end.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nIncrease i and decrease j as long as they don\'t cross each othe... | 1 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Find the Array Concatenation Value Solution in C++ | find-the-array-concatenation-value-solut-ttxb | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | The_Kunal_Singh | NORMAL | 2023-03-22T14:50:16.632906+00:00 | 2023-03-22T14:50:16.632942+00:00 | 15 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$... | 1 | 0 | ['C++'] | 0 |
find-the-array-concatenation-value | Simple java solution | simple-java-solution-by-prithviraj26-62bx | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | prithviraj26 | NORMAL | 2023-03-20T08:46:03.695550+00:00 | 2023-03-20T08:46:03.695579+00:00 | 250 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\no(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n... | 1 | 0 | ['Array', 'Two Pointers', 'Simulation', 'Java'] | 0 |
find-the-array-concatenation-value | Easy Solution Using While Loop in Python | easy-solution-using-while-loop-in-python-32xk | \n\n# Code\n\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n i=0\n c=0\n j=len(nums)-1\n while(i<=j): | sanchisinghal | NORMAL | 2023-03-15T10:23:30.087044+00:00 | 2023-03-15T10:23:30.087098+00:00 | 474 | false | \n\n# Code\n```\nclass Solution:\n def findTheArrayConcVal(self, nums: List[int]) -> int:\n i=0\n c=0\n j=len(nums)-1\n while(i<=j):\n if(i==j):\n c=c+nums[i]\n break\n s=str(nums[i])+str(nums[j])\n c=c+int(s)\n i=i... | 1 | 0 | ['Python3'] | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.