{"submissionId":"cmsokm063000axup2kvqcsxoo","title":"Submission QCSXOO","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":6},{"input":[[]],"output":0},{"input":[[-2,-3,5,8]],"output":6},{"input":[[1,3,5]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of the even values only.","reference_solution":"def solve(nums):\n return sum(x for x in nums if x % 2 == 0)\n"}} {"submissionId":"cmsokm063000bxup2wf64zaya","title":"Submission 64ZAYA","payload":{"test_cases":[{"input":["swiss"],"output":"w"},{"input":["aabb"],"output":""},{"input":[""],"output":""},{"input":["leetcode"],"output":"l"}],"constraints":"0 <= length <= 10^5; input contains printable ASCII characters","time_limit_ms":500,"problem_statement":"Given a string, return the first character that appears exactly once. Return an empty string if none exists.","reference_solution":"def solve(s):\n from collections import Counter\n c = Counter(s)\n for ch in s:\n if c[ch] == 1:\n return ch\n return \"\"\n"}} {"submissionId":"cmsokm063000cxup2ndttpzxm","title":"Submission TTPZXM","payload":{"test_cases":[{"input":[[5,1,5,3]],"output":3},{"input":[[7]],"output":null},{"input":[[2,2,2]],"output":null},{"input":[[-4,-1,-3]],"output":-3}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return the second largest distinct value. Return None if fewer than two distinct values exist.","reference_solution":"def solve(nums):\n vals = set(nums)\n if len(vals) < 2:\n return None\n m = max(vals)\n vals.remove(m)\n return max(vals)\n"}} {"submissionId":"cmsokm063000dxup27x2vqdux","title":"Submission 2VQDUX","payload":{"test_cases":[{"input":[0],"output":0},{"input":[12345],"output":15},{"input":[999999],"output":54},{"input":[1000000000000000000],"output":1}],"constraints":"0 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return the sum of its decimal digits.","reference_solution":"def solve(n):\n return sum(int(ch) for ch in str(n))\n"}} {"submissionId":"cmsokm063000exup2umso2ht6","title":"Submission SO2HT6","payload":{"test_cases":[{"input":["Listen","Silent"],"output":true},{"input":["Dormitory","Dirty room"],"output":false},{"input":["a b","ab "],"output":true},{"input":["",""],"output":true}],"constraints":"0 <= length of each string <= 10^5","time_limit_ms":500,"problem_statement":"Given two strings, determine whether they are anagrams after converting letters to lowercase. Spaces are significant and must also match in count.","reference_solution":"def solve(a, b):\n from collections import Counter\n return Counter(a.lower()) == Counter(b.lower())\n"}} {"submissionId":"cmsokm063000fxup218aihwjj","title":"Submission AIHWJJ","payload":{"test_cases":[{"input":[[1,5,7,2],4],"output":2},{"input":[[],10],"output":0},{"input":[[-1,0,1],-1],"output":2},{"input":[[3,3,3],3],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value,target <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers and a target, return how many values are strictly greater than the target.","reference_solution":"def solve(nums, target):\n return sum(1 for x in nums if x > target)\n"}} {"submissionId":"cmsokm063000gxup23stbvowl","title":"Submission TBVOWL","payload":{"test_cases":[{"input":["racecar"],"output":true},{"input":["Racecar"],"output":false},{"input":[""],"output":true},{"input":["abba"],"output":true}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if it is a palindrome when read exactly as provided, otherwise False.","reference_solution":"def solve(s):\n return s == s[::-1]\n"}} {"submissionId":"cmsokm064000hxup2rsdhg7k4","title":"Submission DHG7K4","payload":{"test_cases":[{"input":[[3,1,4,2]],"output":[3,3,4,4]},{"input":[[]],"output":[]},{"input":[[-5,-2,-7]],"output":[-5,-2,-2]},{"input":[[9,9,10]],"output":[9,9,10]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return a new list containing the running maximum after each position.","reference_solution":"def solve(nums):\n out = []\n cur = None\n for x in nums:\n cur = x if cur is None else max(cur, x)\n out.append(cur)\n return out\n"}} {"submissionId":"cmsokm064000ixup2ajxld82j","title":"Submission XLD82J","payload":{"test_cases":[{"input":[1],"output":[1]},{"input":[12],"output":[1,2,3,4,6,12]},{"input":[13],"output":[1,13]},{"input":[36],"output":[1,2,3,4,6,9,12,18,36]}],"constraints":"1 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given a positive integer n, return a list of all positive divisors of n in increasing order.","reference_solution":"def solve(n):\n small, large = [], []\n d = 1\n while d * d <= n:\n if n % d == 0:\n small.append(d)\n if d * d != n:\n large.append(n // d)\n d += 1\n return small + large[::-1]\n"}} {"submissionId":"cmsokm064000jxup2fkr6rz8t","title":"Submission R6RZ8T","payload":{"test_cases":[{"input":[[1,1,2,2,2,3]],"output":3},{"input":[[]],"output":0},{"input":[[5]],"output":1},{"input":[[4,4,4,4]],"output":4}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the length of the longest contiguous run of equal values.","reference_solution":"def solve(nums):\n if not nums:\n return 0\n best = cur = 1\n for i in range(1, len(nums)):\n if nums[i] == nums[i-1]:\n cur += 1\n else:\n cur = 1\n best = max(best, cur)\n return best\n"}} {"submissionId":"cmsr5n87i000u32p2nwpjnv6j","title":"Submission PJNV6J","payload":{"test_cases":"[{\"input\": [13, 17], \"output\": 30}, {\"input\": [10, 10], \"output\": 20}, {\"input\": [60, 10], \"output\": 70}, {\"input\": [11, 12], \"output\": 23}, {\"input\": [15, 20], \"output\": 35}]","constraints":"10 <= a, b <= 60","time_limit_ms":300,"problem_statement":"Given two integers a and b where 10 <= a, b <= 60, return their sum.","reference_solution":"def solve(a, b):\n return a + b\n"}} {"submissionId":"cmsr5n87i000v32p2nzutf0gi","title":"Submission UTF0GI","payload":{"test_cases":"[{\"input\": [103, 107], \"output\": 210}, {\"input\": [100, 100], \"output\": 200}, {\"input\": [150, 100], \"output\": 250}, {\"input\": [101, 102], \"output\": 203}, {\"input\": [105, 110], \"output\": 215}]","constraints":"100 <= a, b <= 150","time_limit_ms":300,"problem_statement":"Given two integers a and b where 100 <= a, b <= 150, return their sum.","reference_solution":"def solve(a, b):\n return a + b\n"}} {"submissionId":"cmsr5n87i000w32p24c4qqxdt","title":"Submission 4QQXDT","payload":{"test_cases":"[{\"input\": [-47, -43], \"output\": -90}, {\"input\": [-50, -50], \"output\": -100}, {\"input\": [100, -50], \"output\": 50}, {\"input\": [-49, -48], \"output\": -97}, {\"input\": [0, -40], \"output\": -40}]","constraints":"-50 <= a, b <= 100","time_limit_ms":300,"problem_statement":"Given two integers a and b where -50 <= a, b <= 100, return their sum.","reference_solution":"def solve(a, b):\n return a + b\n"}} {"submissionId":"cmsr5n87i000x32p25ny1lalj","title":"Submission Y1LALJ","payload":{"test_cases":"[{\"input\": [1003, 1007], \"output\": 2010}, {\"input\": [1000, 1000], \"output\": 2000}, {\"input\": [1050, 1000], \"output\": 2050}, {\"input\": [1001, 1002], \"output\": 2003}, {\"input\": [1005, 1010], \"output\": 2015}]","constraints":"1000 <= a, b <= 1050","time_limit_ms":300,"problem_statement":"Given two integers a and b where 1000 <= a, b <= 1050, return their sum.","reference_solution":"def solve(a, b):\n return a + b\n"}} {"submissionId":"cmsr5n87i000y32p2veoavdtx","title":"Submission OAVDTX","payload":{"test_cases":"[{\"input\": [-97, -93], \"output\": -190}, {\"input\": [-100, -100], \"output\": -200}, {\"input\": [50, -100], \"output\": -50}, {\"input\": [-99, -98], \"output\": -197}, {\"input\": [0, -90], \"output\": -90}]","constraints":"-100 <= a, b <= 50","time_limit_ms":300,"problem_statement":"Given two integers a and b where -100 <= a, b <= 50, return their sum.","reference_solution":"def solve(a, b):\n return a + b\n"}} {"submissionId":"cmsr5n87i000z32p2bmr02ctp","title":"Submission R02CTP","payload":{"test_cases":"[{\"input\": [\"Hello World123\"], \"output\": 3}, {\"input\": [\"\"], \"output\": 0}, {\"input\": [\"aAeEiIoOuU\"], \"output\": 5}, {\"input\": [\"xyzXYZ001122\"], \"output\": 0}, {\"input\": [\"The Quick Brown Fox Jumps\"], \"output\": 6}]","constraints":"1 <= len(s) <= 10^4, s consists of printable ASCII characters","time_limit_ms":300,"problem_statement":"Given a string s, count how many characters in it are vowels. Return the count as an integer.","reference_solution":"def solve(s):\n target = set('aeiou')\n return sum(1 for c in s if c in target)\n"}} {"submissionId":"cmsr5n87i001032p230br1nr3","title":"Submission BR1NR3","payload":{"test_cases":"[{\"input\": [\"Hello World123\"], \"output\": 3}, {\"input\": [\"\"], \"output\": 0}, {\"input\": [\"aAeEiIoOuU\"], \"output\": 10}, {\"input\": [\"xyzXYZ001122\"], \"output\": 0}, {\"input\": [\"The Quick Brown Fox Jumps\"], \"output\": 6}]","constraints":"1 <= len(s) <= 10^4, s consists of printable ASCII characters","time_limit_ms":300,"problem_statement":"Given a string s, count how many characters in it are vowels case-insensitive. Return the count as an integer.","reference_solution":"def solve(s):\n target = set('aeiouAEIOU')\n return sum(1 for c in s if c in target)\n"}} {"submissionId":"cmsr5n87i001132p2y0jyq1q2","title":"Submission JYQ1Q2","payload":{"test_cases":"[{\"input\": [\"Hello World123\"], \"output\": 3}, {\"input\": [\"\"], \"output\": 0}, {\"input\": [\"aAeEiIoOuU\"], \"output\": 0}, {\"input\": [\"xyzXYZ001122\"], \"output\": 6}, {\"input\": [\"The Quick Brown Fox Jumps\"], \"output\": 0}]","constraints":"1 <= len(s) <= 10^4, s consists of printable ASCII characters","time_limit_ms":300,"problem_statement":"Given a string s, count how many characters in it are digits. Return the count as an integer.","reference_solution":"def solve(s):\n target = set('0123456789')\n return sum(1 for c in s if c in target)\n"}} {"submissionId":"cmsr5n87i001232p2voh13apw","title":"Submission H13APW","payload":{"test_cases":"[{\"input\": [\"Hello World123\"], \"output\": 1}, {\"input\": [\"\"], \"output\": 0}, {\"input\": [\"aAeEiIoOuU\"], \"output\": 0}, {\"input\": [\"xyzXYZ001122\"], \"output\": 0}, {\"input\": [\"The Quick Brown Fox Jumps\"], \"output\": 1}]","constraints":"1 <= len(s) <= 10^4, s consists of printable ASCII characters","time_limit_ms":300,"problem_statement":"Given a string s, count how many characters in it are the letters b,c,d,f,g. Return the count as an integer.","reference_solution":"def solve(s):\n target = set('bcdfg')\n return sum(1 for c in s if c in target)\n"}} {"submissionId":"cmsr5n87i001332p219qk0vdh","title":"Submission QK0VDH","payload":{"test_cases":"[{\"input\": [\"Hello World123\"], \"output\": 0}, {\"input\": [\"\"], \"output\": 0}, {\"input\": [\"aAeEiIoOuU\"], \"output\": 0}, {\"input\": [\"xyzXYZ001122\"], \"output\": 3}, {\"input\": [\"The Quick Brown Fox Jumps\"], \"output\": 1}]","constraints":"1 <= len(s) <= 10^4, s consists of printable ASCII characters","time_limit_ms":300,"problem_statement":"Given a string s, count how many characters in it are the letters x,y,z. Return the count as an integer.","reference_solution":"def solve(s):\n target = set('xyz')\n return sum(1 for c in s if c in target)\n"}} {"submissionId":"cmsr5n87i001432p28s15fnyw","title":"Submission 15FNYW","payload":{"test_cases":"[{\"input\": [[1, 3, 5, 7, 9], 5], \"output\": 2}, {\"input\": [[1, 3, 5, 7, 9], 2], \"output\": -1}, {\"input\": [[2, 4, 6], 2], \"output\": 0}, {\"input\": [[2, 4, 6], 6], \"output\": 2}, {\"input\": [[1], 1], \"output\": 0}]","constraints":"1 <= n <= 10^5","time_limit_ms":400,"problem_statement":"Given a sorted array of distinct integers and a target, return its index or -1 if not found.","reference_solution":"def solve(nums, target):\n lo, hi = 0, len(nums)-1\n while lo <= hi:\n mid = (lo+hi)//2\n if nums[mid] == target:\n return mid\n elif nums[mid] < target:\n lo = mid+1\n else:\n hi = mid-1\n return -1\n"}} {"submissionId":"cmsr5n87i001532p2pchuy763","title":"Submission HUY763","payload":{"test_cases":"[{\"input\": [[1, 2, 2, 2, 5], 2], \"output\": 1}, {\"input\": [[1, 2, 2, 2, 5], 0], \"output\": 0}, {\"input\": [[1, 2, 2, 2, 5], 6], \"output\": 5}, {\"input\": [[], 4], \"output\": 0}, {\"input\": [[1, 3, 3, 3, 3, 9], 3], \"output\": 1}]","constraints":"1 <= n <= 10^5","time_limit_ms":400,"problem_statement":"Given a sorted array (possibly with duplicates) and a target, return the first index where target could be inserted to keep sorted order (leftmost).","reference_solution":"def solve(nums, target):\n lo, hi = 0, len(nums)\n while lo < hi:\n mid = (lo+hi)//2\n if nums[mid] < target:\n lo = mid+1\n else:\n hi = mid\n return lo\n"}} {"submissionId":"cmsr5n87i001632p2p7rn4ej7","title":"Submission RN4EJ7","payload":{"test_cases":"[{\"input\": [[1, 2, 2, 2, 5], 2], \"output\": 3}, {\"input\": [[1, 2, 3], 4], \"output\": 0}, {\"input\": [[5, 5, 5, 5], 5], \"output\": 4}, {\"input\": [[], 1], \"output\": 0}, {\"input\": [[1, 1, 2, 2, 2, 3], 2], \"output\": 3}]","constraints":"1 <= n <= 10^5","time_limit_ms":400,"problem_statement":"Given a sorted array and a target, count how many times the target appears using binary search boundaries.","reference_solution":"def solve(nums, target):\n import bisect\n return bisect.bisect_right(nums,target) - bisect.bisect_left(nums,target)\n"}} {"submissionId":"cmsr5n87i001732p24qgnx3a8","title":"Submission GNX3A8","payload":{"test_cases":"[{\"input\": [[4, 5, 6, 7, 0, 1, 2], 0], \"output\": 4}, {\"input\": [[4, 5, 6, 7, 0, 1, 2], 3], \"output\": -1}, {\"input\": [[1], 0], \"output\": -1}, {\"input\": [[5, 1, 3], 3], \"output\": 2}, {\"input\": [[6, 7, 1, 2, 3, 4, 5], 1], \"output\": 2}]","constraints":"1 <= n <= 10^5","time_limit_ms":400,"problem_statement":"Given a rotated sorted array of distinct integers, find the target's index, or -1 if absent.","reference_solution":"def solve(nums, target):\n lo, hi = 0, len(nums)-1\n while lo <= hi:\n mid = (lo+hi)//2\n if nums[mid] == target:\n return mid\n if nums[lo] <= nums[mid]:\n if nums[lo] <= target < nums[mid]:\n hi = mid-1\n else:\n lo = mid+1\n else:\n if nums[mid] < target <= nums[hi]:\n lo = mid+1\n else:\n hi = mid-1\n return -1\n"}} {"submissionId":"cmsr5n87i001832p2wn8cxexi","title":"Submission 8CXEXI","payload":{"test_cases":"[{\"input\": [[1, 3, 5, 7], 4], \"output\": 2}, {\"input\": [[1, 3, 5, 7], 7], \"output\": 4}, {\"input\": [[1, 3, 5, 7], 10], \"output\": 4}, {\"input\": [[], 5], \"output\": 0}, {\"input\": [[2, 2, 2], 2], \"output\": 3}]","constraints":"1 <= n <= 10^5","time_limit_ms":400,"problem_statement":"Given a sorted array and a target, return the index of the smallest element that is strictly greater than target, or len(nums) if none.","reference_solution":"def solve(nums, target):\n import bisect\n return bisect.bisect_right(nums, target)\n"}} {"submissionId":"cmsr5n87i001932p2stj4bc6v","title":"Submission J4BC6V","payload":{"test_cases":"[{\"input\": [\"the sky is blue\"], \"output\": \"blue is sky the\"}, {\"input\": [\"hello world\"], \"output\": \"world hello\"}, {\"input\": [\"a\"], \"output\": \"a\"}, {\"input\": [\"one two three four\"], \"output\": \"four three two one\"}, {\"input\": [\"keep calm and code on\"], \"output\": \"on code and calm keep\"}]","constraints":"1 <= len(s) <= 10^4, no leading/trailing spaces","time_limit_ms":300,"problem_statement":"Given a sentence with words separated by single spaces, return the sentence with the order of words reversed.","reference_solution":"def solve(s):\n return ' '.join(reversed(s.split(' ')))\n"}} {"submissionId":"cmsr5n87i001a32p25njxjqza","title":"Submission JXJQZA","payload":{"test_cases":"[{\"input\": [\"A man, a plan, a canal: Panama\"], \"output\": true}, {\"input\": [\"race a car\"], \"output\": false}, {\"input\": [\"\"], \"output\": true}, {\"input\": [\"Was it a car or a cat I saw?\"], \"output\": true}, {\"input\": [\"hello\"], \"output\": false}]","constraints":"1 <= len(s) <= 10^4","time_limit_ms":300,"problem_statement":"Given a string, determine if it reads the same forwards and backwards, ignoring case and non-alphanumeric characters.","reference_solution":"def solve(s):\n filtered = [c.lower() for c in s if c.isalnum()]\n return filtered == filtered[::-1]\n"}} {"submissionId":"cmsr5n87i001b32p2apihmv77","title":"Submission IHMV77","payload":{"test_cases":"[{\"input\": [\"the quick brown fox\"], \"output\": \"quick\"}, {\"input\": [\"a bb ccc dd\"], \"output\": \"ccc\"}, {\"input\": [\"equal size aaa bbb\"], \"output\": \"equal\"}, {\"input\": [\"single\"], \"output\": \"single\"}, {\"input\": [\"I love programming challenges\"], \"output\": \"programming\"}]","constraints":"1 <= len(s) <= 10^4","time_limit_ms":300,"problem_statement":"Given a sentence, return the longest word. If there is a tie, return the first one encountered.","reference_solution":"def solve(s):\n words = s.split()\n return max(words, key=len)\n"}} {"submissionId":"cmsr5n87i001c32p24ghtauns","title":"Submission HTAUNS","payload":{"test_cases":"[{\"input\": [\"aabbbcc\"], \"output\": {\"a\": 2, \"b\": 3, \"c\": 2}}, {\"input\": [\"z\"], \"output\": {\"z\": 1}}, {\"input\": [\"abcabc\"], \"output\": {\"a\": 2, \"b\": 2, \"c\": 2}}, {\"input\": [\"\"], \"output\": {}}, {\"input\": [\"mississippi\"], \"output\": {\"m\": 1, \"i\": 4, \"s\": 4, \"p\": 2}}]","constraints":"1 <= len(s) <= 10^4","time_limit_ms":300,"problem_statement":"Given a string, return a dictionary mapping each distinct character to its number of occurrences.","reference_solution":"def solve(s):\n from collections import Counter\n return dict(Counter(s))\n"}} {"submissionId":"cmsr5n87i001d32p2np244omz","title":"Submission 244OMZ","payload":{"test_cases":"[{\"input\": [\"listen\", \"silent\"], \"output\": true}, {\"input\": [\"hello\", \"world\"], \"output\": false}, {\"input\": [\"Dormitory\", \"DirtyRoom\"], \"output\": true}, {\"input\": [\"aab\", \"aba\"], \"output\": true}, {\"input\": [\"abc\", \"abcd\"], \"output\": false}]","constraints":"1 <= len(s) <= 10^4","time_limit_ms":300,"problem_statement":"Given two strings, determine if they are anagrams of each other (same characters, same counts, ignoring case).","reference_solution":"def solve(s1, s2):\n from collections import Counter\n return Counter(s1.lower()) == Counter(s2.lower())\n"}} {"submissionId":"cmsr5n87i001e32p22w5j55rf","title":"Submission 5J55RF","payload":{"test_cases":"[{\"input\": [[-2, 1, -3, 4, -1, 2, 1, -5, 4]], \"output\": 6}, {\"input\": [[1]], \"output\": 1}, {\"input\": [[-1, -2, -3]], \"output\": -1}, {\"input\": [[5, 4, -1, 7, 8]], \"output\": 23}, {\"input\": [[0, 0, 0]], \"output\": 0}]","constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":500,"problem_statement":"Given an array of integers, find the maximum sum of a contiguous subarray (Kadane's algorithm). The array has at least one element.","reference_solution":"def solve(nums):\n best = cur = nums[0]\n for x in nums[1:]:\n cur = max(x, cur+x)\n best = max(best, cur)\n return best\n"}} {"submissionId":"cmsr5n87i001f32p2l6g7qkdo","title":"Submission G7QKDO","payload":{"test_cases":"[{\"input\": [[1, 1, 2, 2, 3]], \"output\": [1, 2, 3]}, {\"input\": [[1, 1, 1]], \"output\": [1]}, {\"input\": [[1, 2, 3]], \"output\": [1, 2, 3]}, {\"input\": [[]], \"output\": []}, {\"input\": [[5, 5, 5, 6, 7, 7]], \"output\": [5, 6, 7]}]","constraints":"1 <= n <= 10^5","time_limit_ms":300,"problem_statement":"Given a sorted array of integers, remove duplicates in place conceptually and return the list of unique values preserving order.","reference_solution":"def solve(nums):\n result = []\n for x in nums:\n if not result or result[-1] != x:\n result.append(x)\n return result\n"}} {"submissionId":"cmsr5n87i001g32p24cu2ply3","title":"Submission U2PLY3","payload":{"test_cases":"[{\"input\": [[1, 2, 3, 4, 5, 6, 7], 3], \"output\": [5, 6, 7, 1, 2, 3, 4]}, {\"input\": [[1, 2], 3], \"output\": [2, 1]}, {\"input\": [[1], 5], \"output\": [1]}, {\"input\": [[1, 2, 3], 0], \"output\": [1, 2, 3]}, {\"input\": [[-1, -100, 3, 99], 2], \"output\": [3, 99, -1, -100]}]","constraints":"1 <= n <= 10^5, 0 <= k <= 10^5","time_limit_ms":300,"problem_statement":"Given an array and an integer k, rotate the array to the right by k steps.","reference_solution":"def solve(nums, k):\n n = len(nums)\n if n == 0:\n return nums\n k = k % n\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsr5n87i001h32p240s6da84","title":"Submission S6DA84","payload":{"test_cases":"[{\"input\": [[1, [2, 3], [4, [5, 6]]]], \"output\": [1, 2, 3, 4, 5, 6]}, {\"input\": [[[1, 2], [3, 4]]], \"output\": [1, 2, 3, 4]}, {\"input\": [[]], \"output\": []}, {\"input\": [[1, 2, 3]], \"output\": [1, 2, 3]}, {\"input\": [[[[[1]]], 2, [3, [4]]]], \"output\": [1, 2, 3, 4]}]","constraints":"total elements <= 10^4","time_limit_ms":400,"problem_statement":"Given a nested list of integers (lists can nest arbitrarily), return a single flat list of all integers in order.","reference_solution":"def solve(nested):\n result = []\n def rec(x):\n for item in x:\n if isinstance(item, list):\n rec(item)\n else:\n result.append(item)\n rec(nested)\n return result\n"}} {"submissionId":"cmsr5n87i001i32p2oiqnflcf","title":"Submission QNFLCF","payload":{"test_cases":"[{\"input\": [[3, 1, 4, 1, 5, 9, 2, 6]], \"output\": 6}, {\"input\": [[1, 2]], \"output\": 1}, {\"input\": [[10, 9]], \"output\": 9}, {\"input\": [[-5, -1, -10]], \"output\": -5}, {\"input\": [[100, 50, 99, 1]], \"output\": 99}]","constraints":"2 <= n <= 10^5","time_limit_ms":300,"problem_statement":"Given an array of distinct integers with at least two elements, return the second largest value.","reference_solution":"def solve(nums):\n first = second = float('-inf')\n for x in nums:\n if x > first:\n first, second = x, first\n elif x > second:\n second = x\n return second\n"}} {"submissionId":"cmsr5n87i001j32p2qilpbevl","title":"Submission LPBEVL","payload":{"test_cases":"[{\"input\": [48, 18], \"output\": 6}, {\"input\": [17, 5], \"output\": 1}, {\"input\": [100, 25], \"output\": 25}, {\"input\": [7, 7], \"output\": 7}, {\"input\": [270, 192], \"output\": 6}]","constraints":"1 <= a, b <= 10^9","time_limit_ms":300,"problem_statement":"Given two positive integers a and b, return their greatest common divisor.","reference_solution":"def solve(a, b):\n while b:\n a, b = b, a % b\n return a\n"}} {"submissionId":"cmsr5n87i001k32p21uhh3glj","title":"Submission HH3GLJ","payload":{"test_cases":"[{\"input\": [2], \"output\": true}, {\"input\": [17], \"output\": true}, {\"input\": [1], \"output\": false}, {\"input\": [100], \"output\": false}, {\"input\": [97], \"output\": true}]","constraints":"1 <= n <= 10^6","time_limit_ms":300,"problem_statement":"Given a positive integer n, determine whether it is a prime number.","reference_solution":"def solve(n):\n if n < 2:\n return False\n i = 2\n while i*i <= n:\n if n % i == 0:\n return False\n i += 1\n return True\n"}} {"submissionId":"cmsr5n87i001l32p2aw7kq5fw","title":"Submission 7KQ5FW","payload":{"test_cases":"[{\"input\": [0], \"output\": 0}, {\"input\": [1], \"output\": 1}, {\"input\": [10], \"output\": 55}, {\"input\": [20], \"output\": 6765}, {\"input\": [5], \"output\": 5}]","constraints":"0 <= n <= 30","time_limit_ms":300,"problem_statement":"Given a non-negative integer n, return the nth Fibonacci number (0-indexed, fib(0)=0, fib(1)=1).","reference_solution":"def solve(n):\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a+b\n return a\n"}} {"submissionId":"cmsr5n87i001m32p2vt1wbnu0","title":"Submission 1WBNU0","payload":{"test_cases":"[{\"input\": [0], \"output\": 1}, {\"input\": [1], \"output\": 1}, {\"input\": [5], \"output\": 120}, {\"input\": [10], \"output\": 3628800}, {\"input\": [7], \"output\": 5040}]","constraints":"0 <= n <= 15","time_limit_ms":300,"problem_statement":"Given a non-negative integer n, return n! (factorial). Assume n is small enough that the result fits in standard integer range.","reference_solution":"def solve(n):\n result = 1\n for i in range(2, n+1):\n result *= i\n return result\n"}} {"submissionId":"cmsr5n87i001n32p2c9sfmrfc","title":"Submission SFMRFC","payload":{"test_cases":"[{\"input\": [123], \"output\": 6}, {\"input\": [9999], \"output\": 36}, {\"input\": [1], \"output\": 1}, {\"input\": [1000000], \"output\": 1}, {\"input\": [54321], \"output\": 15}]","constraints":"1 <= n <= 10^9","time_limit_ms":300,"problem_statement":"Given a positive integer, return the sum of its decimal digits.","reference_solution":"def solve(n):\n return sum(int(d) for d in str(n))\n"}} {"submissionId":"cmsr5n87j001o32p2pcbzgt2j","title":"Submission BZGT2J","payload":{"test_cases":"[{\"input\": [\"()[]{}\"], \"output\": true}, {\"input\": [\"(]\"], \"output\": false}, {\"input\": [\"([{}])\"], \"output\": true}, {\"input\": [\"(((\"], \"output\": false}, {\"input\": [\"\"], \"output\": true}]","constraints":"1 <= len(s) <= 10^4","time_limit_ms":300,"problem_statement":"Given a string of parentheses, brackets, and braces only, determine if it is properly balanced and nested.","reference_solution":"def solve(s):\n stack = []\n pairs = {')':'(', ']':'[', '}':'{'}\n for c in s:\n if c in '([{':\n stack.append(c)\n elif c in pairs:\n if not stack or stack.pop() != pairs[c]:\n return False\n return not stack\n"}} {"submissionId":"cmsr5n87j001p32p24v4lou0d","title":"Submission 4LOU0D","payload":{"test_cases":"[{\"input\": [[\"a\", \"b\", \"a\", \"c\", \"b\", \"a\"]], \"output\": [\"a\"]}, {\"input\": [[\"x\", \"y\", \"z\"]], \"output\": [\"x\"]}, {\"input\": [[\"dog\", \"cat\", \"dog\", \"dog\", \"cat\"]], \"output\": [\"dog\"]}, {\"input\": [[\"one\"]], \"output\": [\"one\"]}, {\"input\": [[\"z\", \"y\", \"x\", \"z\", \"y\", \"z\"]], \"output\": [\"z\"]}]","constraints":"1 <= len(words) <= 10^4","time_limit_ms":400,"problem_statement":"Given a list of lowercase words, return the 1 most frequent word(s) as a list, ordered by descending frequency then alphabetically for ties.","reference_solution":"def solve(words):\n from collections import Counter\n c = Counter(words)\n return sorted(c.keys(), key=lambda w: (-c[w], w))[:1]\n"}} {"submissionId":"cmsr5n87j001q32p2d6czyzec","title":"Submission CZYZEC","payload":{"test_cases":"[{\"input\": [[\"a\", \"b\", \"a\", \"c\", \"b\", \"a\"]], \"output\": [\"a\", \"b\"]}, {\"input\": [[\"x\", \"y\", \"z\"]], \"output\": [\"x\", \"y\"]}, {\"input\": [[\"dog\", \"cat\", \"dog\", \"dog\", \"cat\"]], \"output\": [\"dog\", \"cat\"]}, {\"input\": [[\"one\"]], \"output\": [\"one\"]}, {\"input\": [[\"z\", \"y\", \"x\", \"z\", \"y\", \"z\"]], \"output\": [\"z\", \"y\"]}]","constraints":"1 <= len(words) <= 10^4","time_limit_ms":400,"problem_statement":"Given a list of lowercase words, return the 2 most frequent word(s) as a list, ordered by descending frequency then alphabetically for ties.","reference_solution":"def solve(words):\n from collections import Counter\n c = Counter(words)\n return sorted(c.keys(), key=lambda w: (-c[w], w))[:2]\n"}} {"submissionId":"cmsr5n87j001r32p22hf2xlzf","title":"Submission F2XLZF","payload":{"test_cases":"[{\"input\": [[\"a\", \"b\", \"a\", \"c\", \"b\", \"a\"]], \"output\": [\"a\", \"b\", \"c\"]}, {\"input\": [[\"x\", \"y\", \"z\"]], \"output\": [\"x\", \"y\", \"z\"]}, {\"input\": [[\"dog\", \"cat\", \"dog\", \"dog\", \"cat\"]], \"output\": [\"dog\", \"cat\"]}, {\"input\": [[\"one\"]], \"output\": [\"one\"]}, {\"input\": [[\"z\", \"y\", \"x\", \"z\", \"y\", \"z\"]], \"output\": [\"z\", \"y\", \"x\"]}]","constraints":"1 <= len(words) <= 10^4","time_limit_ms":400,"problem_statement":"Given a list of lowercase words, return the 3 most frequent word(s) as a list, ordered by descending frequency then alphabetically for ties.","reference_solution":"def solve(words):\n from collections import Counter\n c = Counter(words)\n return sorted(c.keys(), key=lambda w: (-c[w], w))[:3]\n"}} {"submissionId":"cmsr5n87j001s32p2hxloianj","title":"Submission LOIANJ","payload":{"test_cases":"[{\"input\": [[[1, 2], [3, 4]]], \"output\": [[1, 3], [2, 4]]}, {\"input\": [[[1, 2, 3]]], \"output\": [[1], [2], [3]]}, {\"input\": [[[1], [2], [3]]], \"output\": [[1, 2, 3]]}, {\"input\": [[[1, 2], [3, 4], [5, 6]]], \"output\": [[1, 3, 5], [2, 4, 6]]}, {\"input\": [[[7]]], \"output\": [[7]]}]","constraints":"1 <= rows, cols <= 100","time_limit_ms":300,"problem_statement":"Given a 2D matrix (list of lists) of integers, return its transpose.","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix)]\n"}} {"submissionId":"cmsr5n87j001t32p2dly9izvw","title":"Submission Y9IZVW","payload":{"test_cases":"[{\"input\": [[[1, 2], [3, 4]]], \"output\": 5}, {\"input\": [[[5]]], \"output\": 5}, {\"input\": [[[1, 0, 0], [0, 1, 0], [0, 0, 1]]], \"output\": 3}, {\"input\": [[[1, 2, 3], [4, 5, 6], [7, 8, 9]]], \"output\": 15}, {\"input\": [[[2, -1], [-1, 2]]], \"output\": 4}]","constraints":"1 <= n <= 100","time_limit_ms":300,"problem_statement":"Given a square matrix, return the sum of its main diagonal elements (top-left to bottom-right).","reference_solution":"def solve(matrix):\n return sum(matrix[i][i] for i in range(len(matrix)))\n"}} {"submissionId":"cmsr5n87j001u32p228qblng8","title":"Submission QBLNG8","payload":{"test_cases":"[{\"input\": [0], \"output\": \"0\"}, {\"input\": [5], \"output\": \"101\"}, {\"input\": [255], \"output\": \"11111111\"}, {\"input\": [1024], \"output\": \"10000000000\"}, {\"input\": [7], \"output\": \"111\"}]","constraints":"0 <= n <= 10^9","time_limit_ms":300,"problem_statement":"Given a non-negative integer, convert it to its binary string representation without a '0b' prefix.","reference_solution":"def solve(n):\n return bin(n)[2:]\n"}} {"submissionId":"cmsr5n87j001v32p2zci0wqna","title":"Submission I0WQNA","payload":{"test_cases":"[{\"input\": [\"101\"], \"output\": 5}, {\"input\": [\"0\"], \"output\": 0}, {\"input\": [\"11111111\"], \"output\": 255}, {\"input\": [\"1\"], \"output\": 1}, {\"input\": [\"1010101\"], \"output\": 85}]","constraints":"1 <= len(s) <= 32","time_limit_ms":300,"problem_statement":"Given a string representing a binary number, convert it to its decimal integer value.","reference_solution":"def solve(s):\n return int(s, 2)\n"}} {"submissionId":"cmsr5n87j001w32p2sdttotk9","title":"Submission TTOTK9","payload":{"test_cases":"[{\"input\": [[2, 7, 11, 15], 9], \"output\": [0, 1]}, {\"input\": [[3, 2, 4], 6], \"output\": [1, 2]}, {\"input\": [[3, 3], 6], \"output\": [0, 1]}, {\"input\": [[1, 2, 3, 4, 5], 9], \"output\": [3, 4]}, {\"input\": [[-3, 4, 3, 90], 0], \"output\": [0, 2]}]","constraints":"2 <= n <= 10^4","time_limit_ms":300,"problem_statement":"Given a list of integers and a target sum, return the indices of the two numbers that add up to target. Assume exactly one solution exists.","reference_solution":"def solve(nums, target):\n seen = {}\n for i, x in enumerate(nums):\n if target - x in seen:\n return [seen[target-x], i]\n seen[x] = i\n"}} {"submissionId":"cmsr5n87j001x32p2pa68qlyr","title":"Submission 68QLYR","payload":{"test_cases":"[{\"input\": [[1, 3, 5], [2, 4, 6]], \"output\": [1, 2, 3, 4, 5, 6]}, {\"input\": [[], [1, 2]], \"output\": [1, 2]}, {\"input\": [[1, 2], []], \"output\": [1, 2]}, {\"input\": [[1, 1, 1], [1, 1]], \"output\": [1, 1, 1, 1, 1]}, {\"input\": [[-5, 0, 5], [-3, 3]], \"output\": [-5, -3, 0, 3, 5]}]","constraints":"0 <= n, m <= 10^4","time_limit_ms":300,"problem_statement":"Given two sorted lists of integers, merge them into a single sorted list.","reference_solution":"def solve(a, b):\n result = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n result.append(a[i]); i += 1\n else:\n result.append(b[j]); j += 1\n result.extend(a[i:])\n result.extend(b[j:])\n return result\n"}} {"submissionId":"cmsr5n87j001y32p2vtv34j87","title":"Submission V34J87","payload":{"test_cases":"[{\"input\": [[3, 0, 1]], \"output\": 2}, {\"input\": [[0, 1]], \"output\": 2}, {\"input\": [[9, 6, 4, 2, 3, 5, 7, 0, 1]], \"output\": 8}, {\"input\": [[0]], \"output\": 1}, {\"input\": [[1]], \"output\": 0}]","constraints":"1 <= n <= 10^5","time_limit_ms":300,"problem_statement":"Given an array containing n distinct numbers taken from 0 to n (inclusive), find the one number missing from the array.","reference_solution":"def solve(nums):\n n = len(nums)\n return n*(n+1)//2 - sum(nums)\n"}} {"submissionId":"cmsr5n87j001z32p2zoapna7h","title":"Submission APNA7H","payload":{"test_cases":"[{\"input\": [[0, 1, 0, 3, 12]], \"output\": [1, 3, 12, 0, 0]}, {\"input\": [[0, 0, 1]], \"output\": [1, 0, 0]}, {\"input\": [[1, 2, 3]], \"output\": [1, 2, 3]}, {\"input\": [[0]], \"output\": [0]}, {\"input\": [[4, 0, 0, 5, 0, 6]], \"output\": [4, 5, 6, 0, 0, 0]}]","constraints":"1 <= n <= 10^5","time_limit_ms":300,"problem_statement":"Given an array of integers, move all zeroes to the end while preserving the relative order of non-zero elements.","reference_solution":"def solve(nums):\n non_zero = [x for x in nums if x != 0]\n return non_zero + [0]*(len(nums)-len(non_zero))\n"}} {"submissionId":"cmsr5n87j002032p2irmyrm7b","title":"Submission MYRM7B","payload":{"test_cases":"[{\"input\": [[3, 2, 3]], \"output\": 3}, {\"input\": [[2, 2, 1, 1, 1, 2, 2]], \"output\": 2}, {\"input\": [[1]], \"output\": 1}, {\"input\": [[5, 5, 5, 1, 2]], \"output\": 5}, {\"input\": [[7, 7, 7, 7, 1, 2, 3]], \"output\": 7}]","constraints":"1 <= n <= 10^5","time_limit_ms":300,"problem_statement":"Given an array of size n, return the majority element (the value that appears more than n/2 times). It is guaranteed to exist.","reference_solution":"def solve(nums):\n from collections import Counter\n return Counter(nums).most_common(1)[0][0]\n"}} {"submissionId":"cmsr5n87j002132p2uwbkdmdf","title":"Submission BKDMDF","payload":{"test_cases":"[{\"input\": [\"42\"], \"output\": 42}, {\"input\": [\" -42\"], \"output\": -42}, {\"input\": [\"4193 with words\"], \"output\": 4193}, {\"input\": [\"words and 987\"], \"output\": 0}, {\"input\": [\"+123abc\"], \"output\": 123}]","constraints":"1 <= len(s) <= 200","time_limit_ms":300,"problem_statement":"Given a string, parse and return the leading integer it represents. Skip leading whitespace, allow an optional + or - sign, then digits; stop at the first non-digit. Return 0 if no valid integer prefix exists.","reference_solution":"def solve(s):\n import re\n m = re.match(r'\\s*([+-]?\\d+)', s)\n return int(m.group(1)) if m else 0\n"}} {"submissionId":"cmsr5n87j002232p2vbk1cijn","title":"Submission K1CIJN","payload":{"test_cases":"[{\"input\": [2.0, 10], \"output\": 1024.0}, {\"input\": [2.0, -2], \"output\": 0.25}, {\"input\": [1.5, 3], \"output\": 3.375}, {\"input\": [5.0, 0], \"output\": 1.0}, {\"input\": [2.0, 5], \"output\": 32.0}]","constraints":"-10 <= n <= 20, 0.1 <= x <= 10","time_limit_ms":300,"problem_statement":"Given a base x (float) and an integer exponent n, compute x raised to the power n using fast exponentiation. n may be negative.","reference_solution":"def solve(x, n):\n if n < 0:\n x = 1/x\n n = -n\n result = 1.0\n while n:\n if n % 2:\n result *= x\n x *= x\n n //= 2\n return round(result, 6)\n"}} {"submissionId":"cmsr5n87j002332p2a7h4ksnb","title":"Submission H4KSNB","payload":{"test_cases":"[{\"input\": [38], \"output\": 2}, {\"input\": [0], \"output\": 0}, {\"input\": [9], \"output\": 9}, {\"input\": [12345], \"output\": 6}, {\"input\": [999999999], \"output\": 9}]","constraints":"0 <= n <= 10^9","time_limit_ms":300,"problem_statement":"Given a non-negative integer, repeatedly sum its digits until the result is a single digit, and return that digit (the digital root).","reference_solution":"def solve(n):\n if n == 0:\n return 0\n return 1 + (n-1) % 9\n"}} {"submissionId":"cmsr5n87j002432p2lhsd1j0b","title":"Submission SD1J0B","payload":{"test_cases":"[{\"input\": [\"abc\", \"ahbgdc\"], \"output\": true}, {\"input\": [\"axc\", \"ahbgdc\"], \"output\": false}, {\"input\": [\"\", \"abc\"], \"output\": true}, {\"input\": [\"abc\", \"abc\"], \"output\": true}, {\"input\": [\"ace\", \"aebdc\"], \"output\": false}]","constraints":"0 <= len(s) <= len(t) <= 10^4","time_limit_ms":300,"problem_statement":"Given two strings s and t, determine whether s is a subsequence of t (characters of s appear in t in the same relative order, not necessarily contiguous).","reference_solution":"def solve(s, t):\n it = iter(t)\n return all(c in it for c in s)\n"}} {"submissionId":"cmsr5n87j002532p2v2kp2tdx","title":"Submission KP2TDX","payload":{"test_cases":"[{\"input\": [[\"flower\", \"flow\", \"flight\"]], \"output\": \"fl\"}, {\"input\": [[\"dog\", \"racecar\", \"car\"]], \"output\": \"\"}, {\"input\": [[\"single\"]], \"output\": \"single\"}, {\"input\": [[\"same\", \"same\", \"same\"]], \"output\": \"same\"}, {\"input\": [[\"ab\", \"a\"]], \"output\": \"a\"}]","constraints":"1 <= len(strs) <= 200","time_limit_ms":300,"problem_statement":"Given a list of strings, return the longest common prefix among all of them. Return an empty string if there is none.","reference_solution":"def solve(strs):\n if not strs:\n return ''\n prefix = strs[0]\n for s in strs[1:]:\n while not s.startswith(prefix):\n prefix = prefix[:-1]\n if not prefix:\n return ''\n return prefix\n"}} {"submissionId":"cmsr5n87j002632p2d0un5kwn","title":"Submission UN5KWN","payload":{"test_cases":"[{\"input\": [[3, 4, 5, 1, 2]], \"output\": 1}, {\"input\": [[4, 5, 6, 7, 0, 1, 2]], \"output\": 0}, {\"input\": [[11, 13, 15, 17]], \"output\": 11}, {\"input\": [[2, 1]], \"output\": 1}, {\"input\": [[1]], \"output\": 1}]","constraints":"1 <= n <= 10^5","time_limit_ms":300,"problem_statement":"Given a rotated sorted array of distinct integers, find the minimum element in O(log n) time.","reference_solution":"def solve(nums):\n lo, hi = 0, len(nums)-1\n while lo < hi:\n mid = (lo+hi)//2\n if nums[mid] > nums[hi]:\n lo = mid+1\n else:\n hi = mid\n return nums[lo]\n"}} {"submissionId":"cmsr5n87j002732p21400g4z1","title":"Submission 00G4Z1","payload":{"test_cases":"[{\"input\": [[1, 2, 3, 2]], \"output\": 4}, {\"input\": [[1, 1, 1, 1, 1]], \"output\": 0}, {\"input\": [[5]], \"output\": 5}, {\"input\": [[4, 3, 2, 3, 5, 4]], \"output\": 7}, {\"input\": [[1, 2, 3, 4, 5]], \"output\": 15}]","constraints":"1 <= n <= 10^5","time_limit_ms":300,"problem_statement":"Given an array of integers, return the sum of elements that appear exactly once (unique elements).","reference_solution":"def solve(nums):\n from collections import Counter\n c = Counter(nums)\n return sum(x for x in nums if c[x] == 1)\n"}} {"submissionId":"cmsrc95yf0000q2p2himi4rtw","title":"Submission MI4RTW","payload":{"test_cases":[{"input":[[1,5,3,7],3],"output":2},{"input":[[],0],"output":0},{"input":[[-2,-1,0],-2],"output":2},{"input":[[4,4,4],4],"output":0}],"constraints":"0 <= n <= 10^5; -10^9 <= value, threshold <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers and a threshold, return how many values are strictly greater than the threshold.","reference_solution":"def solve(nums, threshold):\n return sum(x > threshold for x in nums)\n"}} {"submissionId":"cmsrc95yf0001q2p29p83z8a9","title":"Submission 83Z8A9","payload":{"test_cases":[{"input":[[2,1,3,2,1]],"output":2},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null},{"input":[[5,5]],"output":5}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return the first value whose second occurrence appears earliest while scanning left to right; return None if all values are distinct.","reference_solution":"def solve(nums):\n seen=set()\n for x in nums:\n if x in seen:return x\n seen.add(x)\n return None\n"}} {"submissionId":"cmsrc95yf0002q2p2zkhxjdk5","title":"Submission HXJDK5","payload":{"test_cases":[{"input":[[1,2,3,-5,7]],"output":11},{"input":[[2,4,-1]],"output":0},{"input":[[]],"output":0},{"input":[[9]],"output":9}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return the sum of integers that are both positive and odd.","reference_solution":"def solve(nums):\n return sum(x for x in nums if x>0 and x%2)\n"}} {"submissionId":"cmsrc95yf0003q2p23xd4pzw0","title":"Submission D4PZW0","payload":{"test_cases":[{"input":[[1,2,3,4],1],"output":[4,1,2,3]},{"input":[[1,2,3],3],"output":[1,2,3]},{"input":[[],5],"output":[]},{"input":[[1,2],5],"output":[2,1]}],"constraints":"0 <= n <= 10^5; 0 <= k <= 10^9","time_limit_ms":500,"problem_statement":"Rotate a list to the right by k positions; for an empty list return an empty list.","reference_solution":"def solve(nums,k):\n if not nums:return []\n k%=len(nums)\n return nums[-k:]+nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsrc95yf0004q2p23pmfsl2h","title":"Submission MFSL2H","payload":{"test_cases":[{"input":[[1,1,2,2,2,3]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[4,4,4]],"output":[4]},{"input":[[1,2,1]],"output":[1,2,1]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return a new list with consecutive duplicate values collapsed to one value, preserving order.","reference_solution":"def solve(nums):\n out=[]\n for x in nums:\n if not out or out[-1]!=x:out.append(x)\n return out\n"}} {"submissionId":"cmsrc95yg0005q2p2mzxoagoi","title":"Submission XOAGOI","payload":{"test_cases":[{"input":[["a","hello","xy"]],"output":5},{"input":[[]],"output":0},{"input":[[""]],"output":0},{"input":[["ab","cd"]],"output":2}],"constraints":"0 <= n <= 10^5; total characters <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of strings, return the maximum string length, or 0 for an empty list.","reference_solution":"def solve(words):\n return max((len(w) for w in words),default=0)\n"}} {"submissionId":"cmsrc95yg0006q2p2p54pf2gj","title":"Submission 4PF2GJ","payload":{"test_cases":[{"input":["Education"],"output":5},{"input":["rhythm"],"output":0},{"input":["AaA"],"output":1},{"input":[""],"output":0}],"constraints":"0 <= length <= 10^6","time_limit_ms":500,"problem_statement":"Return how many different English vowels a,e,i,o,u occur in a string, case-insensitively.","reference_solution":"def solve(s):\n return len(set(s.lower()) & set('aeiou'))\n"}} {"submissionId":"cmsrc95yg0007q2p27vk82pwf","title":"Submission K82PWF","payload":{"test_cases":[{"input":[[1,4,2,9]],"output":[3,2,7]},{"input":[[5]],"output":[]},{"input":[[]],"output":[]},{"input":[[-2,3]],"output":[5]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return a list of absolute differences between each pair of adjacent integers.","reference_solution":"def solve(nums):\n return [abs(nums[i]-nums[i-1]) for i in range(1,len(nums))]\n"}} {"submissionId":"cmsrc95yg0008q2p2occ4cnjr","title":"Submission C4CNJR","payload":{"test_cases":[{"input":[[2,9,9,1]],"output":1},{"input":[[]],"output":-1},{"input":[[-3,-1,-2]],"output":1},{"input":[[7]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return the index of the first occurrence of the largest value, or -1 for an empty list.","reference_solution":"def solve(nums):\n if not nums:return -1\n m=max(nums)\n return nums.index(m)\n"}} {"submissionId":"cmsrc95yg0009q2p2z045qc7t","title":"Submission 45QC7T","payload":{"test_cases":[{"input":[[5,8,10],10],"output":[50,80,100]},{"input":[[],7],"output":[]},{"input":[[1,2],3],"output":[33,66]},{"input":[[0],5],"output":[0]}],"constraints":"0 <= n <= 10^5; maximum > 0","time_limit_ms":500,"problem_statement":"Given integer scores and a positive maximum score, return integer floor percentages score*100//maximum.","reference_solution":"def solve(scores, maximum):\n return [s*100//maximum for s in scores]\n"}} {"submissionId":"cmsrc95yg000aq2p22k04plgk","title":"Submission 04PLGK","payload":{"test_cases":[{"input":[[3,1,2,2],[2,4,3]],"output":[2,3]},{"input":[[],[1]],"output":[]},{"input":[[1,1],[1]],"output":[1]},{"input":[[-1,2],[-1,3]],"output":[-1]}],"constraints":"0 <= len(a),len(b) <= 10^5","time_limit_ms":500,"problem_statement":"Return the sorted list of distinct values present in both input lists.","reference_solution":"def solve(a,b):\n return sorted(set(a)&set(b))\n"}} {"submissionId":"cmsrc95yg000bq2p2wdu7n54q","title":"Submission U7N54Q","payload":{"test_cases":[{"input":[[10,3,2,1]],"output":8},{"input":[[]],"output":0},{"input":[[5]],"output":5},{"input":[[-2,-3]],"output":1}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return a0-a1+a2-a3... for the given integer list.","reference_solution":"def solve(nums):\n return sum(x if i%2==0 else -x for i,x in enumerate(nums))\n"}} {"submissionId":"cmsrc95yg000cq2p2r66fq2a4","title":"Submission 6FQ2A4","payload":{"test_cases":[{"input":[[" a "," ","b",""]],"output":2},{"input":[[]],"output":0},{"input":[["\t"]],"output":0},{"input":[["x"]],"output":1}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Count strings that are nonempty after removing surrounding whitespace.","reference_solution":"def solve(values):\n return sum(bool(s.strip()) for s in values)\n"}} {"submissionId":"cmsrc95yg000dq2p23gmmy1si","title":"Submission MMY1SI","payload":{"test_cases":[{"input":[[3,1,5,2]],"output":[3,3,5,5]},{"input":[[]],"output":[]},{"input":[[-3,-5,-1]],"output":[-3,-3,-1]},{"input":[[2,2]],"output":[2,2]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return a list whose ith value is the maximum among the first i+1 input values.","reference_solution":"def solve(nums):\n out=[]\n for x in nums:\n out.append(x if not out else max(out[-1],x))\n return out\n"}} {"submissionId":"cmsrc95yg000eq2p2spr0xy8r","title":"Submission R0XY8R","payload":{"test_cases":[{"input":["one two three"],"output":"three two one"},{"input":[" a b "],"output":"b a"},{"input":[""],"output":""},{"input":["solo"],"output":"solo"}],"constraints":"0 <= length <= 10^6","time_limit_ms":500,"problem_statement":"Given a sentence with arbitrary whitespace, return its words joined by single spaces in reverse order.","reference_solution":"def solve(s):\n return ' '.join(reversed(s.split()))\n"}} {"submissionId":"cmsrc95yg000fq2p2o6tng65t","title":"Submission TNG65T","payload":{"test_cases":[{"input":[1,10,3],"output":3},{"input":[5,5,5],"output":1},{"input":[-5,5,2],"output":5},{"input":[1,2,5],"output":0}],"constraints":"-10^9 <= left <= right <= 10^9; d > 0","time_limit_ms":500,"problem_statement":"Given integers left,right,d with left<=right and d>0, return how many integers in [left,right] are divisible by d.","reference_solution":"def solve(left,right,d):\n return right//d - ((left-1)//d)\n"}} {"submissionId":"cmsrc95yg000gq2p2a1jt0vmv","title":"Submission JT0VMV","payload":{"test_cases":[{"input":[[1,2,4],[2,3,4]],"output":[1,2,3,4]},{"input":[[],[1]],"output":[1]},{"input":[[],[]],"output":[]},{"input":[[-2,0],[-1,0]],"output":[-2,-1,0]}],"constraints":"0 <= lengths <= 10^5","time_limit_ms":500,"problem_statement":"Given two sorted integer lists, return a sorted list containing each value that appears in either list exactly once.","reference_solution":"def solve(a,b):\n return sorted(set(a)|set(b))\n"}} {"submissionId":"cmsrc95yg000hq2p2xspawb98","title":"Submission PAWB98","payload":{"test_cases":[{"input":[[1,1,2,3,3,3]],"output":[2,1,3]},{"input":[[]],"output":[]},{"input":[[5]],"output":[1]},{"input":[[1,2,3]],"output":[1,1,1]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Return lengths of consecutive equal-value runs in the input list.","reference_solution":"def solve(nums):\n if not nums:return []\n out=[];count=1\n for i in range(1,len(nums)):\n if nums[i]==nums[i-1]:count+=1\n else:out.append(count);count=1\n out.append(count)\n return out\n"}} {"submissionId":"cmsrc95yg000iq2p2vmm8ty59","title":"Submission M8TY59","payload":{"test_cases":[{"input":["aabb","a","b"],"output":true},{"input":["aba","a","b"],"output":false},{"input":["xyz","a","b"],"output":true},{"input":["","x","y"],"output":true}],"constraints":"0 <= length <= 10^6","time_limit_ms":500,"problem_statement":"Given a string and two single-character symbols, return True when the string contains the same number of each symbol.","reference_solution":"def solve(s,a,b):\n return s.count(a)==s.count(b)\n"}} {"submissionId":"cmsrc95yg000jq2p2ieh955vd","title":"Submission H955VD","payload":{"test_cases":[{"input":[[1,5,9],3,7],"output":[3,5,7]},{"input":[[],0,1],"output":[]},{"input":[[-5,0,5],-2,2],"output":[-2,0,2]},{"input":[[4],4,4],"output":[4]}],"constraints":"0 <= n <= 10^5; low <= high","time_limit_ms":500,"problem_statement":"Clamp each integer into inclusive bounds low..high.","reference_solution":"def solve(nums,low,high):\n return [min(high,max(low,x)) for x in nums]\n"}} {"submissionId":"cmsrfcgb1000ky8p2f8kom05a","title":"Submission KOM05A","payload":{"test_cases":[{"input":[[3,-2,5,0,-1]],"output":8},{"input":[[-4,-1,0]],"output":0},{"input":[[7]],"output":7},{"input":[[]],"output":0}],"constraints":"0 <= n <= 1000, -10^4 <= value <= 10^4","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of only the positive values. Zero and negative values do not contribute.","reference_solution":"def solve(nums):\n return sum(x for x in nums if x > 0)\n"}} {"submissionId":"cmsrfcgb1000ly8p2wzpbsma1","title":"Submission PBSMA1","payload":{"test_cases":[{"input":["banana"],"output":3},{"input":["aaaa"],"output":1},{"input":[""],"output":0},{"input":["abcde"],"output":5}],"constraints":"0 <= length <= 10^5, lowercase English letters only","time_limit_ms":500,"problem_statement":"Given a lowercase string, return the number of distinct characters it contains.","reference_solution":"def solve(s):\n return len(set(s))\n"}} {"submissionId":"cmsrfcgb1000my8p2ysw5yc7w","title":"Submission W5YC7W","payload":{"test_cases":[{"input":[[10,20,30,40,50]],"output":[10,30,50]},{"input":[[1,2]],"output":[1]},{"input":[[]],"output":[]},{"input":[[9]],"output":[9]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given an integer list, return a new list containing the elements at even indices 0,2,4,... in their original order.","reference_solution":"def solve(nums):\n return nums[::2]\n"}} {"submissionId":"cmsrfcgb1000ny8p2emn7u9he","title":"Submission N7U9HE","payload":{"test_cases":[{"input":[3,7],"output":5},{"input":[7,3],"output":5},{"input":[4,4],"output":1},{"input":[-2,2],"output":5}],"constraints":"-10^9 <= a,b <= 10^9","time_limit_ms":500,"problem_statement":"Given two integers a and b, return the inclusive count of integers between them after ordering the endpoints.","reference_solution":"def solve(a,b):\n lo, hi = sorted((a,b))\n return hi - lo + 1\n"}} {"submissionId":"cmsrfcgb1000oy8p2bdbt943g","title":"Submission BT943G","payload":{"test_cases":[{"input":[["cat","elephant","dog"]],"output":8},{"input":[[]],"output":0},{"input":[["a"]],"output":1},{"input":[["same","size"]],"output":4}],"constraints":"0 <= number of words <= 1000, each word length <= 1000","time_limit_ms":500,"problem_statement":"Given a list of words, return the length of the longest word. Return 0 for an empty list.","reference_solution":"def solve(words):\n return max((len(w) for w in words), default=0)\n"}} {"submissionId":"cmsrmig0j001ojmp2tenwa9ca","title":"Submission NWA9CA","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],4],"output":[3,1,2]},{"input":[[7],3],"output":[7]},{"input":[[],5],"output":[]},{"input":[[1,2,3,4],0],"output":[1,2,3,4]}],"constraints":"0 <= len(nums) <= 10^4, -10^4 <= nums[i] <= 10^4, 0 <= k <= 10^5 (k may exceed the length of nums)","time_limit_ms":500,"problem_statement":"You are given a list of integers and a non-negative integer k. Rotate the list to the right by k positions, so that each element moves k places toward the end and elements that fall off the end wrap around to the front. Return the rotated list.","reference_solution":"def solve(nums, k):\n n = len(nums)\n if n == 0:\n return []\n k = k % n\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsrmig0j001pjmp230rrjoie","title":"Submission RRJOIE","payload":{"test_cases":[{"input":[[3,3,4,2,3,3,1]],"output":3},{"input":[[1]],"output":1},{"input":[[2,2,1,1,1,2,2]],"output":2},{"input":[[5,5,5,5,1,2,3]],"output":5},{"input":[[-1,-1,0,-1,2]],"output":-1}],"constraints":"1 <= n <= 10^5, -10^9 <= nums[i] <= 10^9, a majority element is guaranteed to exist","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers in which exactly one value occurs more than floor(n / 2) times (the majority element), return that value.","reference_solution":"def solve(nums):\n count = 0\n candidate = None\n for n in nums:\n if count == 0:\n candidate = n\n count += 1 if n == candidate else -1\n return candidate\n"}} {"submissionId":"cmsrmig0j001qjmp21lezj4v6","title":"Submission EZJ4V6","payload":{"test_cases":[{"input":["leetcode"],"output":0},{"input":["aabbcc"],"output":-1},{"input":["swiss"],"output":1},{"input":[""],"output":-1},{"input":["z"],"output":0}],"constraints":"0 <= len(s) <= 10^5, s consists of lowercase English letters","time_limit_ms":500,"problem_statement":"Given a string s, return the index of the first character that does not repeat anywhere else in the string. If every character repeats, return -1.","reference_solution":"def solve(s):\n from collections import Counter\n counts = Counter(s)\n for i, ch in enumerate(s):\n if counts[ch] == 1:\n return i\n return -1\n"}} {"submissionId":"cmsrmig0j001rjmp2sc926ljw","title":"Submission 926LJW","payload":{"test_cases":[{"input":[[2,1,5,1,3,2],3],"output":9},{"input":[[1,2,3],0],"output":null},{"input":[[1,2,3],5],"output":null},{"input":[[-1,-2,-3,-4],2],"output":-3},{"input":[[4],1],"output":4}],"constraints":"0 <= len(nums) <= 10^5, -10^4 <= nums[i] <= 10^4, -10 <= k <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers nums and an integer k, find the maximum possible sum of any contiguous subarray whose length is exactly k. If k is 0, negative, or greater than the length of nums, return null (None).","reference_solution":"def solve(nums, k):\n n = len(nums)\n if k <= 0 or k > n:\n return None\n window = sum(nums[:k])\n best = window\n for i in range(k, n):\n window += nums[i] - nums[i - k]\n if window > best:\n best = window\n return best\n"}} {"submissionId":"cmsrmig0j001sjmp2xglwik9m","title":"Submission LWIK9M","payload":{"test_cases":[{"input":[[1,3,5],[2,4,6]],"output":[1,2,3,4,5,6]},{"input":[[],[1,2]],"output":[1,2]},{"input":[[1,1,2],[1,3]],"output":[1,1,1,2,3]},{"input":[[],[]],"output":[]},{"input":[[5,5,5],[1,2]],"output":[1,2,5,5,5]}],"constraints":"0 <= len(a), len(b) <= 10^5, -10^9 <= value <= 10^9, both a and b are individually sorted non-decreasing","time_limit_ms":500,"problem_statement":"Given two lists of integers that are each already sorted in non-decreasing order, merge them into a single list that is also sorted in non-decreasing order, preserving all elements (including duplicates).","reference_solution":"def solve(a, b):\n result = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n result.append(a[i])\n i += 1\n else:\n result.append(b[j])\n j += 1\n result.extend(a[i:])\n result.extend(b[j:])\n return result\n"}} {"submissionId":"cmsshnwld002ljmp2wb4wps5c","title":"Submission 4WPS5C","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":6},{"input":[[2,4,6,8]],"output":20},{"input":[[1,3,5,7]],"output":0},{"input":[[-2,-4,3]],"output":-6},{"input":[[0]],"output":0}],"constraints":"1 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of all even numbers in the list.","reference_solution":"def solve(nums):\n return sum(x for x in nums if x % 2 == 0)\n"}} {"submissionId":"cmsshnwld002mjmp220lrq69v","title":"Submission LRQ69V","payload":{"test_cases":[{"input":["hello"],"output":"olleh"},{"input":["abcd"],"output":"dcba"},{"input":["a"],"output":"a"},{"input":[""],"output":""},{"input":["racecar"],"output":"racecar"}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the string reversed.","reference_solution":"def solve(s):\n return s[::-1]\n"}} {"submissionId":"cmsshnwld002njmp2jl7unqe7","title":"Submission 7UNQE7","payload":{"test_cases":[{"input":[0],"output":0},{"input":[1],"output":1},{"input":[5],"output":5},{"input":[10],"output":55},{"input":[20],"output":6765}],"constraints":"0 <= n <= 50","time_limit_ms":500,"problem_statement":"Given an integer n, return the nth Fibonacci number. The sequence starts with F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2.","reference_solution":"def solve(n):\n if n == 0:\n return 0\n a, b = 0, 1\n for _ in range(n - 1):\n a, b = b, a + b\n return b\n"}} {"submissionId":"cmsshnwld002ojmp2brhoe3th","title":"Submission HOE3TH","payload":{"test_cases":[{"input":[[3,1,4,1,5,9,2,6]],"output":5},{"input":[[1]],"output":0},{"input":[[5,5,5]],"output":0},{"input":[[-3,-1,-2]],"output":1},{"input":[[10,20,30]],"output":2}],"constraints":"1 <= n <= 10^4, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return the index of the maximum element. If multiple elements share the maximum value, return the smallest index.","reference_solution":"def solve(nums):\n max_val = nums[0]\n max_idx = 0\n for i in range(1, len(nums)):\n if nums[i] > max_val:\n max_val = nums[i]\n max_idx = i\n return max_idx\n"}} {"submissionId":"cmsshnwld002pjmp2pj6liahv","title":"Submission 6LIAHV","payload":{"test_cases":[{"input":["madam"],"output":true},{"input":["hello"],"output":false},{"input":[""],"output":true},{"input":["Aba"],"output":false},{"input":["abba"],"output":true}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if it is a palindrome (reads the same forwards and backwards), and False otherwise. The check is case-sensitive.","reference_solution":"def solve(s):\n return s == s[::-1]\n"}} {"submissionId":"cmsshnwld002qjmp2p5ernkk9","title":"Submission ERNKK9","payload":{"test_cases":[{"input":[12,8],"output":4},{"input":[100,75],"output":25},{"input":[17,13],"output":1},{"input":[36,36],"output":36},{"input":[1,1000000000],"output":1}],"constraints":"1 <= a, b <= 10^9","time_limit_ms":500,"problem_statement":"Given two integers a and b, return their greatest common divisor (GCD).","reference_solution":"def solve(a, b):\n while b:\n a, b = b, a % b\n return a\n"}} {"submissionId":"cmsshnwld002rjmp2f3yvtufk","title":"Submission YVTUFK","payload":{"test_cases":[{"input":[[1,2,2,3,1]],"output":[1,2,3]},{"input":[[5,5,5,5]],"output":[5]},{"input":[[1,2,3]],"output":[1,2,3]},{"input":[[-1,-1,0,1,1]],"output":[-1,0,1]},{"input":[[7]],"output":[7]}],"constraints":"1 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, return a new list containing only the unique elements, preserving the order of first occurrence.","reference_solution":"def solve(nums):\n seen = set()\n result = []\n for x in nums:\n if x not in seen:\n seen.add(x)\n result.append(x)\n return result\n"}} {"submissionId":"cmsshnwld002sjmp22w7pznyd","title":"Submission 7PZNYD","payload":{"test_cases":[{"input":[2],"output":true},{"input":[1],"output":false},{"input":[0],"output":false},{"input":[17],"output":true},{"input":[100],"output":false}],"constraints":"0 <= n <= 10^6","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return True if n is a prime number, and False otherwise.","reference_solution":"def solve(n):\n if n < 2:\n return False\n if n == 2:\n return True\n if n % 2 == 0:\n return False\n i = 3\n while i * i <= n:\n if n % i == 0:\n return False\n i += 2\n return True\n"}} {"submissionId":"cmsshnwld002tjmp2h1skjn0f","title":"Submission SKJN0F","payload":{"test_cases":[{"input":[[1,2,2,3,3,3]],"output":[3]},{"input":[[1,1,2,2]],"output":[1,2]},{"input":[[5]],"output":[5]},{"input":[[4,4,3,3,2]],"output":[3,4]},{"input":[[0,0,0,1,1,1]],"output":[0,1]}],"constraints":"1 <= n <= 10^4, -10^4 <= value <= 10^4","time_limit_ms":500,"problem_statement":"Given a list of integers, return the two numbers that appear most frequently. If there is a tie, return all tied numbers sorted in ascending order. Return the result as a list.","reference_solution":"def solve(nums):\n from collections import Counter\n freq = Counter(nums)\n max_freq = max(freq.values())\n return sorted(k for k, v in freq.items() if v == max_freq)\n"}} {"submissionId":"cmsshnwld002ujmp2wfp0xu4r","title":"Submission P0XU4R","payload":{"test_cases":[{"input":[0],"output":1},{"input":[1],"output":1},{"input":[5],"output":120},{"input":[10],"output":3628800},{"input":[20],"output":2432902008176640000}],"constraints":"0 <= n <= 20","time_limit_ms":500,"problem_statement":"Given a positive integer n, return its factorial (n!). The factorial of 0 is 1.","reference_solution":"def solve(n):\n result = 1\n for i in range(2, n + 1):\n result *= i\n return result\n"}} {"submissionId":"cmsshnwld002vjmp2xsnwe6yc","title":"Submission NWE6YC","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],0],"output":[1,2,3]},{"input":[[1,2,3],3],"output":[1,2,3]},{"input":[[10,20,30,40],1],"output":[40,10,20,30]},{"input":[[7],100],"output":[7]}],"constraints":"1 <= n <= 10^4, 0 <= k <= 10^5, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, rotate it to the right by k positions. Elements shifted off the end wrap around to the beginning. Return the rotated list.","reference_solution":"def solve(nums, k):\n n = len(nums)\n k = k % n\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsshnwld002wjmp2zaowd815","title":"Submission OWD815","payload":{"test_cases":[{"input":[[1,1,2,2,2,3]],"output":3},{"input":[[5,5,5,5]],"output":4},{"input":[[1,2,3,4]],"output":1},{"input":[[1,1,1,2,1,1]],"output":3},{"input":[[7]],"output":1}],"constraints":"1 <= n <= 10^5, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, return the length of the longest contiguous subarray where all elements are equal.","reference_solution":"def solve(nums):\n max_len = 1\n curr_len = 1\n for i in range(1, len(nums)):\n if nums[i] == nums[i - 1]:\n curr_len += 1\n max_len = max(max_len, curr_len)\n else:\n curr_len = 1\n return max_len\n"}} {"submissionId":"cmsshnwld002xjmp2whjkxl29","title":"Submission JKXL29","payload":{"test_cases":[{"input":[[-2,1,-3,4,-1,2,1,-5,4]],"output":6},{"input":[[1]],"output":1},{"input":[[-3,-2,-1]],"output":-1},{"input":[[5,4,-1,7,8]],"output":23},{"input":[[0,-3,0]],"output":0}],"constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of integers, return the maximum subarray sum. The subarray must contain at least one element.","reference_solution":"def solve(nums):\n max_sum = nums[0]\n curr_sum = nums[0]\n for i in range(1, len(nums)):\n curr_sum = max(nums[i], curr_sum + nums[i])\n max_sum = max(max_sum, curr_sum)\n return max_sum\n"}} {"submissionId":"cmsshnwld002yjmp2dyeb3m6l","title":"Submission EB3M6L","payload":{"test_cases":[{"input":["aab"],"output":{"a":2,"b":1}},{"input":[""],"output":{}},{"input":["zzz"],"output":{"z":3}},{"input":["abc"],"output":{"a":1,"b":1,"c":1}},{"input":["aabbcc"],"output":{"a":2,"b":2,"c":2}}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string of lowercase letters, return a dictionary mapping each character to the number of times it appears in the string.","reference_solution":"def solve(s):\n freq = {}\n for c in s:\n freq[c] = freq.get(c, 0) + 1\n return freq\n"}} {"submissionId":"cmsshnwld002zjmp27a0fyfma","title":"Submission 0FYFMA","payload":{"test_cases":[{"input":[[5,3,1,4,2]],"output":[1,2,3,4,5]},{"input":[[1]],"output":[1]},{"input":[[2,2,2]],"output":[2,2,2]},{"input":[[-3,-1,-2]],"output":[-3,-2,-1]},{"input":[[10,-10,0]],"output":[-10,0,10]}],"constraints":"1 <= n <= 500, -10^4 <= value <= 10^4","time_limit_ms":2000,"problem_statement":"Given a list of integers, return the list sorted in ascending order using bubble sort. Do not use any built-in sort function.","reference_solution":"def solve(nums):\n arr = nums[:]\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n"}} {"submissionId":"cmsshnwld0030jmp2cael4dj3","title":"Submission EL4DJ3","payload":{"test_cases":[{"input":[[[1,1,0],[1,0,0],[0,0,1]],0,0],"output":3},{"input":[[[1]],0,0],"output":1},{"input":[[[1,0,1],[0,0,0],[1,0,1]],0,0],"output":1},{"input":[[[1,1],[1,1]],1,1],"output":4},{"input":[[[1,1,1],[1,1,1],[1,1,1]],1,1],"output":9}],"constraints":"1 <= r, c <= 50, grid values are 0 or 1, 0 <= row < r, 0 <= col < c, grid[row][col] == 1","time_limit_ms":1000,"problem_statement":"Given a 2D grid of integers with r rows and c columns, and a starting cell (row, col), return the number of cells reachable from that cell using 4-directional moves (up, down, left, right), counting only cells with value 1. The starting cell has value 1.","reference_solution":"def solve(grid, row, col):\n from collections import deque\n rows, cols = len(grid), len(grid[0])\n visited = set()\n queue = deque([(row, col)])\n visited.add((row, col))\n count = 0\n while queue:\n r, c = queue.popleft()\n count += 1\n for dr, dc in [(-1,0),(1,0),(0,-1),(0,1)]:\n nr, nc = r + dr, c + dc\n if 0 <= nr < rows and 0 <= nc < cols and grid[nr][nc] == 1 and (nr, nc) not in visited:\n visited.add((nr, nc))\n queue.append((nr, nc))\n return count\n"}} {"submissionId":"cmsshnwld0031jmp2u5uz57ut","title":"Submission UZ57UT","payload":{"test_cases":[{"input":[[1,5,10],11],"output":2},{"input":[[2],3],"output":-1},{"input":[[1,2,5],11],"output":3},{"input":[[1],0],"output":0},{"input":[[3,7],14],"output":2}],"constraints":"1 <= len(coins) <= 12, 1 <= coins[i] <= 10^4, 0 <= amount <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of non-negative integers representing coin denominations and a target amount, return the minimum number of coins needed to make up the amount. You may use each coin denomination as many times as needed. Return -1 if it is not possible.","reference_solution":"def solve(coins, amount):\n dp = [float('inf')] * (amount + 1)\n dp[0] = 0\n for i in range(1, amount + 1):\n for c in coins:\n if c <= i:\n dp[i] = min(dp[i], dp[i - c] + 1)\n return dp[amount] if dp[amount] != float('inf') else -1\n"}} {"submissionId":"cmsshnwld0032jmp2urcl1hrv","title":"Submission CL1HRV","payload":{"test_cases":[{"input":["123"],"output":6},{"input":["0000"],"output":0},{"input":["9"],"output":9},{"input":[""],"output":0},{"input":["987"],"output":24}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string containing digits '0'-'9', return the sum of all the individual digits in the string.","reference_solution":"def solve(s):\n return sum(int(c) for c in s if c.isdigit())\n"}} {"submissionId":"cmsshnwld0033jmp2k7g7i21f","title":"Submission G7I21F","payload":{"test_cases":[{"input":[[1,2,3,4],5],"output":true},{"input":[[1,2,3,4],8],"output":false},{"input":[[0,0],0],"output":true},{"input":[[-1,1,2],0],"output":true},{"input":[[5,5],11],"output":false}],"constraints":"2 <= n <= 10^5, -10^9 <= value <= 10^9, -2*10^9 <= k <= 2*10^9","time_limit_ms":500,"problem_statement":"Given a list of integers and an integer k, return True if any two distinct elements in the list sum to k, and False otherwise.","reference_solution":"def solve(nums, k):\n seen = set()\n for x in nums:\n if k - x in seen:\n return True\n seen.add(x)\n return False\n"}} {"submissionId":"cmsshnwle0034jmp2eorh7b5d","title":"Submission RH7B5D","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":[24,12,8,6]},{"input":[[2,3]],"output":[3,2]},{"input":[[1,0,3]],"output":[0,3,0]},{"input":[[-1,1,2,-2]],"output":[-4,4,2,-2]},{"input":[[5,5,5,5]],"output":[125,125,125,125]}],"constraints":"2 <= n <= 10^4, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of integers, return a new list where each element is replaced by the product of all other elements. You may not use division.","reference_solution":"def solve(nums):\n n = len(nums)\n result = [1] * n\n prefix = 1\n for i in range(n):\n result[i] = prefix\n prefix *= nums[i]\n suffix = 1\n for i in range(n - 1, -1, -1):\n result[i] *= suffix\n suffix *= nums[i]\n return result\n"}} {"submissionId":"cmsshnwle0035jmp2su0q7c1s","title":"Submission 0Q7C1S","payload":{"test_cases":[{"input":[0],"output":0},{"input":[1],"output":1},{"input":[7],"output":3},{"input":[255],"output":8},{"input":[2147483647],"output":31}],"constraints":"0 <= n <= 2^31 - 1","time_limit_ms":500,"problem_statement":"Given a positive integer n, return the number of 1-bits (set bits) in its binary representation.","reference_solution":"def solve(n):\n count = 0\n while n:\n count += n & 1\n n >>= 1\n return count\n"}} {"submissionId":"cmsshnwle0036jmp2tl928lum","title":"Submission 928LUM","payload":{"test_cases":[{"input":[["eat","tea","tan","ate","nat","bat"]],"output":[["ate","eat","tea"],["bat"],["nat","tan"]]},{"input":[["a"]],"output":[["a"]]},{"input":[["",""]],"output":[["",""]]},{"input":[["abc","bca","cab"]],"output":[["abc","bca","cab"]]},{"input":[["dog","god","cat"]],"output":[["cat"],["dog","god"]]}],"constraints":"1 <= n <= 10^4, 0 <= len(each string) <= 100, strings contain only lowercase letters","time_limit_ms":1000,"problem_statement":"Given a list of strings, group the anagrams together and return a list of groups. Each group is a sorted list of strings. The output list of groups should be sorted by the first element of each group.","reference_solution":"def solve(words):\n from collections import defaultdict\n groups = defaultdict(list)\n for w in words:\n key = tuple(sorted(w))\n groups[key].append(w)\n result = [sorted(g) for g in groups.values()]\n return sorted(result, key=lambda g: g[0])\n"}} {"submissionId":"cmsshnwle0037jmp2qm2d8sg2","title":"Submission 2D8SG2","payload":{"test_cases":[{"input":[1],"output":[1]},{"input":[12],"output":[1,2,3,4,6,12]},{"input":[7],"output":[1,7]},{"input":[36],"output":[1,2,3,4,6,9,12,18,36]},{"input":[100],"output":[1,2,4,5,10,20,25,50,100]}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer n, return all divisors of n in ascending order as a list.","reference_solution":"def solve(n):\n divisors = []\n i = 1\n while i * i <= n:\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n i += 1\n return sorted(divisors)\n"}} {"submissionId":"cmsshnwle0038jmp2s9y44e50","title":"Submission Y44E50","payload":{"test_cases":[{"input":[[2,3,1,2,4,3],7],"output":2},{"input":[[1,1,1,1,1],10],"output":0},{"input":[[10,2,3],6],"output":1},{"input":[[1,2,3,4,5],11],"output":3},{"input":[[5,1,3],9],"output":3}],"constraints":"1 <= n <= 10^5, 1 <= s <= 10^9, 1 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of integers, return the length of the shortest contiguous subarray whose sum is greater than or equal to a given target s. If no such subarray exists, return 0.","reference_solution":"def solve(nums, s):\n n = len(nums)\n min_len = float('inf')\n left = 0\n curr_sum = 0\n for right in range(n):\n curr_sum += nums[right]\n while curr_sum >= s:\n min_len = min(min_len, right - left + 1)\n curr_sum -= nums[left]\n left += 1\n return min_len if min_len != float('inf') else 0\n"}} {"submissionId":"cmssijww300hqjmp2tbv7t6tw","title":"Submission V7T6TW","payload":{"test_cases":[{"input":[[3,5,2]],"output":10},{"input":[[]],"output":0},{"input":[[10000,10000]],"output":20000},{"input":[[1]],"output":1}],"constraints":"0 <= n <= 10^5 orders, 1 <= each order <= 10^4","time_limit_ms":1000,"problem_statement":"A bakery named Flourish tracks daily orders as a list of positive integers (number of loaves per order). Given the list of orders for a day, compute the total number of loaves baked. If the list is empty, the bakery baked nothing that day.","reference_solution":"def solve(orders):\n return sum(orders)\n"}} {"submissionId":"cmssijww300hrjmp2jpnym3th","title":"Submission NYM3TH","payload":{"test_cases":[{"input":[[1,5,10],6],"output":2},{"input":[[],3],"output":0},{"input":[[100,200,300],50],"output":0},{"input":[[1,1,1],2],"output":3}],"constraints":"0 <= n <= 10^5 books, 1 <= due day, current day <= 10^9","time_limit_ms":1000,"problem_statement":"A small library named Cedar Stacks assigns each book a due date represented as an integer day number. Given a list of due-day integers for currently checked-out books and the current day number, return the count of overdue books (due day strictly less than current day).","reference_solution":"def solve(due_days, current_day):\n count = 0\n for d in due_days:\n if d < current_day:\n count += 1\n return count\n"}} {"submissionId":"cmssijww300hsjmp2rfz9ls88","title":"Submission Z9LS88","payload":{"test_cases":[{"input":[["Bob","Alice","Bob","Charlie"]],"output":["Alice","Bob","Charlie"]},{"input":[[]],"output":[]},{"input":[["Zoe"]],"output":["Zoe"]},{"input":[["ann","Ann"]],"output":["Ann","ann"]}],"constraints":"0 <= n <= 10^4 names, each name has length 1 to 50 using ASCII letters","time_limit_ms":1000,"problem_statement":"You are organizing a coding club named ByteCircle's attendance sheet. Given a list of member names (strings, may contain duplicates because some members signed in twice by mistake), return the list of unique member names sorted alphabetically.","reference_solution":"def solve(names):\n return sorted(set(names))\n"}} {"submissionId":"cmssijww300htjmp2c5g6d8va","title":"Submission G6D8VA","payload":{"test_cases":[{"input":[[7,1,5,3,6,4]],"output":5},{"input":[[7,6,4,3,1]],"output":0},{"input":[[]],"output":0},{"input":[[5]],"output":0}],"constraints":"0 <= n <= 10^5 days, 0 <= price <= 10^4","time_limit_ms":1000,"problem_statement":"A vending-machine company called SnackTrail wants to know the maximum single-day profit from a list of daily snack prices, where profit is the difference between a later day's price and an earlier day's price (buy low, sell high, must buy before selling). Given the list of daily prices, return the maximum achievable profit, or 0 if no profit is possible.","reference_solution":"def solve(prices):\n if not prices:\n return 0\n min_price = prices[0]\n best = 0\n for p in prices[1:]:\n if p - min_price > best:\n best = p - min_price\n if p < min_price:\n min_price = p\n return best\n"}} {"submissionId":"cmssinu7j00lmjmp2m3jt1asy","title":"Submission JT1ASY","payload":{"test_cases":[{"input":["hello"],"output":"olleh"},{"input":[""],"output":""},{"input":["a"],"output":"a"},{"input":["abba"],"output":"abba"},{"input":["12345"],"output":"54321"}],"constraints":"0 <= length <= 10^5, string contains only printable ASCII characters","time_limit_ms":500,"problem_statement":"Given a string, return its reverse.","reference_solution":"def solve(s):\n return s[::-1]\n"}} {"submissionId":"cmssinu7j00lnjmp2okwwyggg","title":"Submission WWYGGG","payload":{"test_cases":[{"input":[[3,1,4,1,5,9]],"output":9},{"input":[[-5,-1,-3]],"output":-1},{"input":[[7]],"output":7},{"input":[[0,0,0]],"output":0}],"constraints":"1 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return the maximum element. The list is guaranteed to be non-empty.","reference_solution":"def solve(nums):\n return max(nums)\n"}} {"submissionId":"cmssinu7j00lojmp2mq8lkqk3","title":"Submission 8LKQK3","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["",""],"output":true},{"input":["rat","car"],"output":false}],"constraints":"0 <= length(s), length(t) <= 10^4","time_limit_ms":500,"problem_statement":"Given two strings s and t, return true if t is an anagram of s, and false otherwise. Both strings consist of lowercase English letters only.","reference_solution":"def solve(s, t):\n return sorted(s) == sorted(t)\n"}} {"submissionId":"cmssinu7j00lpjmp2lhfolo5u","title":"Submission FOLO5U","payload":{"test_cases":[{"input":[123],"output":6},{"input":[0],"output":0},{"input":[999],"output":27},{"input":[10],"output":1},{"input":[1000000000],"output":1}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return the sum of its digits.","reference_solution":"def solve(n):\n return sum(int(d) for d in str(n))\n"}} {"submissionId":"cmssinu7j00lqjmp2zc5bkvcv","title":"Submission 5BKVCV","payload":{"test_cases":[{"input":[[1,2,3,2,2,4],2],"output":3},{"input":[[1,1,1,1],5],"output":0},{"input":[[],1],"output":0},{"input":[[7],7],"output":1}],"constraints":"0 <= n <= 10^5, -10^9 <= value, target <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers and a target integer, return the number of times the target appears in the list.","reference_solution":"def solve(nums, target):\n return nums.count(target)\n"}} {"submissionId":"cmssiw3ml00oujmp2xm73f72b","title":"Submission 73F72B","payload":{"test_cases":[{"input":[[2,7,11,15],9],"output":[0,1]},{"input":[[3,2,4],6],"output":[1,2]},{"input":[[1,5,3,8],20],"output":[]}],"constraints":"1 <= n <= 10^4, exactly one valid pair exists if any","time_limit_ms":500,"problem_statement":"Given an array of integers and a target, return the indices of the two numbers that add up to the target (in order of first index, then second), or an empty list if no pair exists.","reference_solution":"def solve(nums, target):\n seen = {}\n for i, n in enumerate(nums):\n if target - n in seen:\n return [seen[target - n], i]\n seen[n] = i\n return []"}} {"submissionId":"cmssiw3ml00ovjmp26bn6k4lf","title":"Submission N6K4LF","payload":{"test_cases":[{"input":["the sky is blue"],"output":"blue is sky the"},{"input":["hello world"],"output":"world hello"},{"input":["single"],"output":"single"}],"constraints":"1 <= length <= 10^4, words separated by single spaces, no leading/trailing whitespace","time_limit_ms":500,"problem_statement":"Given a sentence of space-separated words, return the words in reverse order, joined by a single space.","reference_solution":"def solve(sentence):\n return \" \".join(reversed(sentence.split()))"}} {"submissionId":"cmssiw3ml00owjmp2bz1f1hsv","title":"Submission 1F1HSV","payload":{"test_cases":[{"input":["Hello World"],"output":3},{"input":["AEIOU"],"output":5},{"input":["xyz"],"output":0}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, count the number of vowels (a, e, i, o, u), case-insensitive.","reference_solution":"def solve(s):\n return sum(1 for c in s.lower() if c in \"aeiou\")"}} {"submissionId":"cmssiw3ml00oxjmp2298c375b","title":"Submission 8C375B","payload":{"test_cases":[{"input":[[-2,1,-3,4,-1,2,1,-5,4]],"output":6},{"input":[[1]],"output":1},{"input":[[-1,-2,-3]],"output":-1}],"constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":500,"problem_statement":"Given a non-empty array of integers, find the contiguous subarray with the largest sum and return that sum.","reference_solution":"def solve(nums):\n best = nums[0]\n current = nums[0]\n for n in nums[1:]:\n current = max(n, current + n)\n best = max(best, current)\n return best"}} {"submissionId":"cmssiw3ml00oyjmp2ca8f43es","title":"Submission 8F43ES","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["",""],"output":true}],"constraints":"0 <= length <= 10^4, lowercase ASCII letters only","time_limit_ms":500,"problem_statement":"Given two strings, determine if the second string is an anagram of the first (uses exactly the same characters with the same frequency).","reference_solution":"def solve(a, b):\n return sorted(a) == sorted(b)"}} {"submissionId":"cmsskqnnk013ajmp2210z46gm","title":"Submission 0Z46GM","payload":{"test_cases":[{"input":[[2,7,11,15],9],"output":[0,1]},{"input":[[3,2,4],6],"output":[1,2]},{"input":[[3,3],6],"output":[0,1]},{"input":[[1,2,3],100],"output":[-1,-1]}],"constraints":"1 <= n <= 10^4, -10^9 <= nums[i], target <= 10^9","time_limit_ms":500,"problem_statement":"Given an array of integers and a target integer, return the indices of the first pair of two distinct elements whose values add up to the target. If found, return the earlier-completed pair in the order they were found scanning left to right; if none exists, return [-1, -1].","reference_solution":"def solve(nums, target):\n seen = {}\n for i, n in enumerate(nums):\n complement = target - n\n if complement in seen:\n return [seen[complement], i]\n seen[n] = i\n return [-1, -1]\n"}} {"submissionId":"cmsskqnnk013bjmp2c31ccoip","title":"Submission 1CCOIP","payload":{"test_cases":[{"input":["Hello World"],"output":3},{"input":[""],"output":0},{"input":["AEIOUaeiou"],"output":10},{"input":["xyz"],"output":0}],"constraints":"0 <= length <= 10^5, string contains printable ASCII characters","time_limit_ms":500,"problem_statement":"Given a string, count the number of vowels (a, e, i, o, u) it contains, ignoring case.","reference_solution":"def solve(s):\n return sum(1 for c in s.lower() if c in 'aeiou')\n"}} {"submissionId":"cmsskqnnk013cjmp22dt5n1ym","title":"Submission T5N1YM","payload":{"test_cases":[{"input":[[-2,1,-3,4,-1,2,1,-5,4]],"output":6},{"input":[[1]],"output":1},{"input":[[-1,-2,-3]],"output":-1},{"input":[[5,4,-1,7,8]],"output":23}],"constraints":"1 <= n <= 10^5, -10^4 <= nums[i] <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers (which may include negative numbers), find the maximum possible sum of a contiguous non-empty subarray.","reference_solution":"def solve(nums):\n best = nums[0]\n cur = nums[0]\n for n in nums[1:]:\n cur = max(n, cur + n)\n best = max(best, cur)\n return best\n"}} {"submissionId":"cmsslvy8x0186jmp2denx7p2e","title":"Submission NX7P2E","payload":{"test_cases":[{"input":[1234],"output":10},{"input":[0],"output":0},{"input":[-56],"output":11},{"input":[9],"output":9}],"constraints":"-10^9 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given an integer n (which may be negative), return the sum of the decimal digits of its absolute value.","reference_solution":"def solve(n):\n return sum(int(d) for d in str(abs(n)))\n"}} {"submissionId":"cmsslvy8x0187jmp2e6r2us6u","title":"Submission R2US6U","payload":{"test_cases":[{"input":["Hello World"],"output":"World Hello"},{"input":[" a b c "],"output":"c b a"},{"input":["single"],"output":"single"},{"input":[""],"output":""}],"constraints":"0 <= length of sentence <= 10^4","time_limit_ms":500,"problem_statement":"Given a sentence with words separated by arbitrary amounts of whitespace, return a new sentence with the words in reverse order, separated by single spaces, with no leading or trailing whitespace.","reference_solution":"def solve(s):\n return ' '.join(s.split()[::-1])\n"}} {"submissionId":"cmsslvy8y0189jmp2n5mb0enm","title":"Submission MB0ENM","payload":{"test_cases":[{"input":[[3,1,4,1,5,9,2,6]],"output":6},{"input":[[5,5,5]],"output":null},{"input":[[1,2]],"output":1},{"input":[[10,9,8,7]],"output":9}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given an array of integers, return the second largest distinct value in the array. If there are fewer than two distinct values, return null.","reference_solution":"def solve(nums):\n distinct = sorted(set(nums), reverse=True)\n return distinct[1] if len(distinct) > 1 else None\n"}} {"submissionId":"cmsslvy8y018ajmp2wjdv08u3","title":"Submission DV08U3","payload":{"test_cases":[{"input":["A man, a plan, a canal: Panama"],"output":true},{"input":["race a car"],"output":false},{"input":[""],"output":true},{"input":["No 'x' in Nixon"],"output":true}],"constraints":"0 <= length of string <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, determine whether it is a palindrome when ignoring case and any characters that are not letters or digits.","reference_solution":"def solve(s):\n filtered = [c.lower() for c in s if c.isalnum()]\n return filtered == filtered[::-1]\n"}} {"submissionId":"cmssm6ryf01c2jmp2o4ao0kys","title":"Submission AO0KYS","payload":{"test_cases":[{"input":[1,20,3],"output":2},{"input":[100,105,1],"output":1},{"input":[1,100,10],"output":9},{"input":[500000,500010,5],"output":1}],"constraints":"1 <= l <= r <= 10^6, 0 <= s <= 54","time_limit_ms":1000,"problem_statement":"Given integers l, r, and s, count how many integers x with l <= x <= r have decimal digit sum exactly equal to s.","reference_solution":"def solve(l, r, s):\n count = 0\n for x in range(l, r + 1):\n if sum(int(d) for d in str(x)) == s:\n count += 1\n return count\n"}} {"submissionId":"cmssm6ryf01c3jmp25jsu2tn2","title":"Submission SU2TN2","payload":{"test_cases":[{"input":["aaabbc"],"output":"a3b2c1"},{"input":[""],"output":""},{"input":["AAAA"],"output":"A4"},{"input":["abcd"],"output":"a1b1c1d1"}],"constraints":"0 <= length of s <= 10^5, string contains only English letters","time_limit_ms":500,"problem_statement":"Given a string s consisting only of English letters (a-z, A-Z), produce its run-length encoding: replace every maximal run of identical consecutive characters with that character followed immediately by the run's length written in decimal (no separators). If s is empty, return the empty string.","reference_solution":"def solve(s):\n if not s:\n return \"\"\n result = []\n prev = s[0]\n count = 1\n for c in s[1:]:\n if c == prev:\n count += 1\n else:\n result.append(prev + str(count))\n prev = c\n count = 1\n result.append(prev + str(count))\n return \"\".join(result)\n"}} {"submissionId":"cmssm6ryf01c4jmp2q5js0yq4","title":"Submission JS0YQ4","payload":{"test_cases":[{"input":[[5,1,4,3,2]],"output":4},{"input":[[10,10,9]],"output":9},{"input":[[7]],"output":-1},{"input":[[-1,-2,-3]],"output":-2}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given an array of integers, return the second largest distinct value. If fewer than two distinct values exist, return -1.","reference_solution":"def solve(nums):\n uniq = sorted(set(nums), reverse=True)\n if len(uniq) < 2:\n return -1\n return uniq[1]\n"}} {"submissionId":"cmssm6ryf01c5jmp2lv4ujnrc","title":"Submission 4UJNRC","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":true},{"input":[[1,3,2]],"output":false},{"input":[[]],"output":true},{"input":[[5]],"output":true}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given an array of integers, determine whether it is sorted in non-decreasing order (each element is less than or equal to the next).","reference_solution":"def solve(nums):\n return all(nums[i] <= nums[i + 1] for i in range(len(nums) - 1))\n"}} {"submissionId":"cmssm6ryf01c6jmp2nfbuhxke","title":"Submission BUHXKE","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],0],"output":[1,2,3]},{"input":[[1,2,3],3],"output":[1,2,3]},{"input":[[1],5],"output":[1]}],"constraints":"0 <= n <= 10^5, 0 <= k <= 10^9","time_limit_ms":500,"problem_statement":"Given an array of integers and a non-negative integer k, rotate the array to the right by k positions and return the result.","reference_solution":"def solve(nums, k):\n if not nums:\n return nums\n k = k % len(nums)\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmssub2py004vg4p2ol0q0x32","title":"Submission 0Q0X32","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":6},{"input":[[-2,-3,5,8]],"output":6},{"input":[[]],"output":0},{"input":[[7,9]],"output":0}],"constraints":"0 <= n <= 10^5; -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of all even values.","reference_solution":"def solve(nums):\n return sum(x for x in nums if x % 2 == 0)\n"}} {"submissionId":"cmssub2py004wg4p2zgrdijtl","title":"Submission RDIJTL","payload":{"test_cases":[{"input":["DataBounty"],"output":4},{"input":["XYZ"],"output":0},{"input":["AEiou"],"output":5},{"input":[""],"output":0}],"constraints":"0 <= length <= 10^5; ASCII letters and symbols","time_limit_ms":500,"problem_statement":"Given a string, count how many characters are vowels (a, e, i, o, u), ignoring case.","reference_solution":"def solve(s):\n return sum(ch.lower() in 'aeiou' for ch in s)\n"}} {"submissionId":"cmssub2py004xg4p2u3j572ku","title":"Submission J572KU","payload":{"test_cases":[{"input":[[4,9,2,5]],"output":7},{"input":[[3]],"output":0},{"input":[[]],"output":0},{"input":[[-5,5,-1]],"output":10}],"constraints":"0 <= n <= 10^5; -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return the largest absolute difference between adjacent elements. Return 0 for fewer than two elements.","reference_solution":"def solve(nums):\n if len(nums) < 2:\n return 0\n return max(abs(nums[i]-nums[i-1]) for i in range(1,len(nums)))\n"}} {"submissionId":"cmssub2py004zg4p2ispld8uj","title":"Submission PLD8UJ","payload":{"test_cases":[{"input":[["Cat","cat","DOG"]],"output":2},{"input":[[]],"output":0},{"input":[["A","a","B","b","C"]],"output":3},{"input":[["same","same"]],"output":1}],"constraints":"0 <= n <= 10^5; each word length <= 100","time_limit_ms":500,"problem_statement":"Given a list of words, return the number of distinct words after converting each word to lowercase.","reference_solution":"def solve(words):\n return len({w.lower() for w in words})\n"}} {"submissionId":"cmssub2py0050g4p2mgfp09ke","title":"Submission FP09KE","payload":{"test_cases":[{"input":[18,24],"output":6},{"input":[7,13],"output":1},{"input":[0,9],"output":9},{"input":[100,40],"output":20}],"constraints":"0 <= a,b <= 10^18; not both zero","time_limit_ms":500,"problem_statement":"Given integers a and b, return their greatest common divisor.","reference_solution":"def solve(a,b):\n import math\n return math.gcd(a,b)\n"}} {"submissionId":"cmssub2py0051g4p2c3589ff4","title":"Submission 589FF4","payload":{"test_cases":[{"input":[[1,5,8,2],4],"output":2},{"input":[[],10],"output":0},{"input":[[-3,-1,0],-2],"output":2},{"input":[[4,4,4],4],"output":0}],"constraints":"0 <= n <= 10^5; values and t fit signed 64-bit range","time_limit_ms":500,"problem_statement":"Given a list of integers and a threshold t, return how many elements are strictly greater than t.","reference_solution":"def solve(nums,t):\n return sum(x > t for x in nums)\n"}} {"submissionId":"cmssub2py0052g4p2p7ghi01c","title":"Submission GHI01C","payload":{"test_cases":[{"input":["Level"],"output":true},{"input":["hello"],"output":false},{"input":[""],"output":true},{"input":["Aa"],"output":true}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if it reads the same forward and backward after converting letters to lowercase; otherwise return False.","reference_solution":"def solve(s):\n t=s.lower()\n return t==t[::-1]\n"}} {"submissionId":"cmssub2py0053g4p2ivmff9wx","title":"Submission MFF9WX","payload":{"test_cases":[{"input":[[3,1,5,2]],"output":[3,3,5,5]},{"input":[[-2,-5,-1]],"output":[-2,-2,-1]},{"input":[[]],"output":[]},{"input":[[7,7]],"output":[7,7]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return a new list containing the running maximum after each position.","reference_solution":"def solve(nums):\n out=[]\n best=None\n for x in nums:\n best=x if best is None or x>best else best\n out.append(best)\n return out\n"}} {"submissionId":"cmssub2py0054g4p2klnz4dv4","title":"Submission NZ4DV4","payload":{"test_cases":[{"input":[1],"output":true},{"input":[16],"output":true},{"input":[18],"output":false},{"input":[1024],"output":true}],"constraints":"1 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a positive integer n, return True if n is a power of two and False otherwise.","reference_solution":"def solve(n):\n return n>0 and (n & (n-1))==0\n"}} {"submissionId":"cmssub2py0055g4p2tydagxq9","title":"Submission DAGXQ9","payload":{"test_cases":[{"input":[[1,7,3,4]],"output":3},{"input":[[2,2,2]],"output":1},{"input":[[]],"output":0},{"input":[[1]],"output":1}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the count of positions whose value equals the 1-based index of that position.","reference_solution":"def solve(nums):\n return sum(x==i for i,x in enumerate(nums,1))\n"}} {"submissionId":"cmssub2py0056g4p2xh8j5cew","title":"Submission 8J5CEW","payload":{"test_cases":[{"input":["aaabbcaaaa"],"output":4},{"input":["abc"],"output":1},{"input":[""],"output":0},{"input":["zzzz"],"output":4}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the length of its longest run of identical consecutive characters. Return 0 for the empty string.","reference_solution":"def solve(s):\n if not s:return 0\n best=cur=1\n for i in range(1,len(s)):\n cur=cur+1 if s[i]==s[i-1] else 1\n best=max(best,cur)\n return best\n"}} {"submissionId":"cmssub2py0057g4p2ce4x7pbq","title":"Submission 4X7PBQ","payload":{"test_cases":[{"input":[[5,1,4,2,3]],"output":12},{"input":[[]],"output":0},{"input":[[-1,10,-2]],"output":-3},{"input":[[7]],"output":7}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of elements at even zero-based indices.","reference_solution":"def solve(nums):\n return sum(nums[::2])\n"}} {"submissionId":"cmssub2pz0058g4p2xn97c3fn","title":"Submission 97C3FN","payload":{"test_cases":[{"input":[[1,1,3,5]],"output":true},{"input":[[2,1]],"output":false},{"input":[[]],"output":true},{"input":[[9]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return True if it is non-decreasing from left to right.","reference_solution":"def solve(nums):\n return all(nums[i-1] <= nums[i] for i in range(1,len(nums)))\n"}} {"submissionId":"cmssub2pz0059g4p248klxok6","title":"Submission KLXOK6","payload":{"test_cases":[{"input":["karolin","kathrin"],"output":3},{"input":["abc","abc"],"output":0},{"input":["",""],"output":0},{"input":["10101","11100"],"output":2}],"constraints":"0 <= length <= 10^5; strings have equal length","time_limit_ms":500,"problem_statement":"Given two strings, return the number of positions at which they contain different characters. The strings have equal length.","reference_solution":"def solve(a,b):\n return sum(x!=y for x,y in zip(a,b))\n"}} {"submissionId":"cmssub2pz005ag4p2ogveo5nr","title":"Submission VEO5NR","payload":{"test_cases":[{"input":[[0,1,0,3,12]],"output":[1,3,12,0,0]},{"input":[[0,0]],"output":[0,0]},{"input":[[1,2]],"output":[1,2]},{"input":[[]],"output":[]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, move all zero values to the end while preserving the relative order of nonzero values.","reference_solution":"def solve(nums):\n nz=[x for x in nums if x!=0]\n return nz+[0]*(len(nums)-len(nz))\n"}} {"submissionId":"cmssub2pz005bg4p2nwhan9bf","title":"Submission HAN9BF","payload":{"test_cases":[{"input":[[5,1,5,3]],"output":3},{"input":[[7,7]],"output":null},{"input":[[]],"output":null},{"input":[[-1,-3,-2]],"output":-2}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the second largest distinct value, or None if fewer than two distinct values exist.","reference_solution":"def solve(nums):\n vals=sorted(set(nums), reverse=True)\n return vals[1] if len(vals)>=2 else None\n"}} {"submissionId":"cmssub2pz005cg4p23cdxacnw","title":"Submission DXACNW","payload":{"test_cases":[{"input":["one two three"],"output":"three two one"},{"input":[" alpha beta "],"output":"beta alpha"},{"input":[""],"output":""},{"input":["solo"],"output":"solo"}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string containing words separated by whitespace, return the words in reverse order joined by one space.","reference_solution":"def solve(s):\n return ' '.join(reversed(s.split()))\n"}} {"submissionId":"cmssub2pz005dg4p2n0umsei1","title":"Submission UMSEI1","payload":{"test_cases":[{"input":[[2,0,3,-1]],"output":-6},{"input":[[0,0]],"output":1},{"input":[[]],"output":1},{"input":[[4,5]],"output":20}],"constraints":"0 <= n <= 30; product fits signed 64-bit range","time_limit_ms":500,"problem_statement":"Given a list of integers, return the product of all nonzero elements. If every element is zero or the list is empty, return 1.","reference_solution":"def solve(nums):\n p=1\n for x in nums:\n if x!=0:p*=x\n return p\n"}} {"submissionId":"cmssub2pz005eg4p2gaeooeml","title":"Submission EOOEML","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2],4],"output":[1,2]},{"input":[[],3],"output":[]},{"input":[[9],99],"output":[9]}],"constraints":"0 <= n <= 10^5; 0 <= k <= 10^18","time_limit_ms":500,"problem_statement":"Given a list of integers and integer k, return the list rotated right by k positions. For an empty list return an empty list.","reference_solution":"def solve(nums,k):\n if not nums:return []\n k%=len(nums)\n return nums[-k:]+nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmssub2pz005gg4p2rzft8m7v","title":"Submission FT8M7V","payload":{"test_cases":[{"input":[0],"output":1},{"input":[1],"output":1},{"input":[5],"output":120},{"input":[10],"output":3628800}],"constraints":"0 <= n <= 20","time_limit_ms":500,"problem_statement":"Given an integer n >= 0, return n! (n factorial).","reference_solution":"def solve(n):\n import math\n return math.factorial(n)\n"}} {"submissionId":"cmssub2pz005hg4p242s9l8dd","title":"Submission S9L8DD","payload":{"test_cases":[{"input":[[2,3,4,1],6],"output":2},{"input":[[1,1,1],3],"output":3},{"input":[[5],4],"output":0},{"input":[[],10],"output":0}],"constraints":"0 <= n <= 10^5; 0 <= value, limit <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, return the length of the longest prefix whose sum is not greater than a given limit. All list values are non-negative.","reference_solution":"def solve(nums,limit):\n total=0\n for i,x in enumerate(nums):\n if total+x>limit:return i\n total+=x\n return len(nums)\n"}} {"submissionId":"cmssub2pz005ig4p2wrr488a0","title":"Submission R488A0","payload":{"test_cases":[{"input":["aaabccdddda"],"output":"abcda"},{"input":[""],"output":""},{"input":["abc"],"output":"abc"},{"input":["zzzzz"],"output":"z"}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return a new string with consecutive duplicate characters collapsed to a single character.","reference_solution":"def solve(s):\n out=[]\n for ch in s:\n if not out or out[-1]!=ch:out.append(ch)\n return ''.join(out)\n"}} {"submissionId":"cmssub2pz005jg4p2md9aec8g","title":"Submission 9AEC8G","payload":{"test_cases":[{"input":[[5,-2,4,-3]],"output":4},{"input":[[-1,-2]],"output":-3},{"input":[[1,2]],"output":3},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5; values fit signed 32-bit range","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of positive values minus the absolute sum of negative values; zeros contribute nothing.","reference_solution":"def solve(nums):\n return sum(nums)\n"}} {"submissionId":"cmssub2pz005kg4p2k415hc62","title":"Submission 15HC62","payload":{"test_cases":[{"input":[1,10],"output":3},{"input":[0,0],"output":1},{"input":[3,3],"output":1},{"input":[4,8],"output":1}],"constraints":"0 <= a <= b <= 10^18","time_limit_ms":500,"problem_statement":"Given two non-negative integers a and b, return the count of integer values in the inclusive range [a,b] that are divisible by 3.","reference_solution":"def solve(a,b):\n return b//3 - ((a-1)//3 if a>0 else -1)\n"}} {"submissionId":"cmssub2pz005lg4p22svzd3jg","title":"Submission VZD3JG","payload":{"test_cases":[{"input":[[4,2,7,2]],"output":1},{"input":[[]],"output":-1},{"input":[[-1,-5,-3]],"output":1},{"input":[[9]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the index of the first minimum value. Return -1 for an empty list.","reference_solution":"def solve(nums):\n return nums.index(min(nums)) if nums else -1\n"}} {"submissionId":"cmssub2pz005mg4p2swceimib","title":"Submission CEIMIB","payload":{"test_cases":[{"input":["banana"],"output":"a"},{"input":["bbaacc"],"output":"a"},{"input":[""],"output":""},{"input":["zzz"],"output":"z"}],"constraints":"0 <= length <= 10^5; lowercase a-z only","time_limit_ms":500,"problem_statement":"Given a string of lowercase letters, return the character with the highest frequency; break ties by choosing the alphabetically smallest character. Return an empty string for empty input.","reference_solution":"def solve(s):\n if not s:return ''\n from collections import Counter\n c=Counter(s)\n m=max(c.values())\n return min(ch for ch,v in c.items() if v==m)\n"}} {"submissionId":"cmssub2pz005ng4p20560cfux","title":"Submission 60CFUX","payload":{"test_cases":[{"input":[[1,2,3]],"output":true},{"input":[[1,2,1]],"output":false},{"input":[[]],"output":true},{"input":[[0]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return True if no value appears more than once.","reference_solution":"def solve(nums):\n return len(nums)==len(set(nums))\n"}} {"submissionId":"cmssub2pz005og4p235vv5ph8","title":"Submission VV5PH8","payload":{"test_cases":[{"input":[12],"output":[1,2,3,4,6,12]},{"input":[1],"output":[1]},{"input":[7],"output":[1,7]},{"input":[16],"output":[1,2,4,8,16]}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer n, return a list of all positive divisors of n in increasing order.","reference_solution":"def solve(n):\n return [d for d in range(1,n+1) if n%d==0]\n"}} {"submissionId":"cmsuh6klm00hlg4p2slhwxh2a","title":"Submission HWXH2A","payload":{"test_cases":[{"input":[48,18],"output":[6,144]},{"input":[7,13],"output":[1,91]},{"input":[100,25],"output":[25,100]}],"constraints":"1 <= a, b <= 10^9","time_limit_ms":500,"problem_statement":"Given two positive integers, return a list containing their greatest common divisor (GCD) and least common multiple (LCM), in that order.","reference_solution":"def solve(a, b):\n import math\n g = math.gcd(a, b)\n l = a * b // g\n return [g, l]\n"}} {"submissionId":"cmsuh6klm00hmg4p2hys9lnkf","title":"Submission S9LNKF","payload":{"test_cases":[{"input":[121],"output":true},{"input":[123],"output":false},{"input":[7],"output":true},{"input":[1001],"output":true}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given a non-negative integer, determine whether it reads the same forwards and backwards (a palindrome), without converting it to a string using built-in reversal tricks beyond simple string slicing.","reference_solution":"def solve(n):\n s = str(n)\n return s == s[::-1]\n"}} {"submissionId":"cmsuh6klm00hng4p2dfxssgv4","title":"Submission XSSGV4","payload":{"test_cases":[{"input":[[[1,2,3],[4,5,6]]],"output":[[1,4],[2,5],[3,6]]},{"input":[[[1]]],"output":[[1]]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":500,"problem_statement":"Given a 2D matrix represented as a list of rows, return its transpose (rows become columns).","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix)]\n"}} {"submissionId":"cmsuh6klm00hog4p20oc4qgyj","title":"Submission C4QGYJ","payload":{"test_cases":[{"input":["leetcode"],"output":0},{"input":["loveleetcode"],"output":2},{"input":["aabb"],"output":-1}],"constraints":"1 <= length <= 10^5, lowercase ASCII letters only","time_limit_ms":500,"problem_statement":"Given a string, return the index of the first character that does not repeat anywhere else in the string. If every character repeats, return -1.","reference_solution":"def solve(s):\n from collections import Counter\n c = Counter(s)\n for i, ch in enumerate(s):\n if c[ch] == 1:\n return i\n return -1\n"}} {"submissionId":"cmsuh6klm00hpg4p2ah1j1wwn","title":"Submission 1J1WWN","payload":{"test_cases":[{"input":[[1,5,3,4,2],2],"output":3},{"input":[[1,2,3,4],10],"output":0},{"input":[[1,2,3,4,5],1],"output":4}],"constraints":"1 <= n <= 10^5, k >= 1, all elements distinct","time_limit_ms":500,"problem_statement":"Given an array of distinct integers and a positive integer k, count the number of unordered pairs of elements in the array whose absolute difference is exactly k.","reference_solution":"def solve(nums, k):\n seen = set(nums)\n count = 0\n for n in nums:\n if n + k in seen:\n count += 1\n return count\n"}} {"submissionId":"cmsuj0v3l00k6g4p2ezl6ksal","title":"Submission L6KSAL","payload":{"test_cases":[{"input":[[70,71,69,72,72,75]],"output":3},{"input":[[50]],"output":0},{"input":[[10,9,8,7]],"output":0},{"input":[[1,2,3,4,5]],"output":4}],"constraints":"1 <= n <= 10^4, -100 <= temperature <= 100","time_limit_ms":500,"problem_statement":"You are given a list of temperatures recorded once per hour. Return the number of hours where the temperature was strictly higher than the previous hour's reading. The first hour never counts.","reference_solution":"def solve(temps):\n count = 0\n for i in range(1, len(temps)):\n if temps[i] > temps[i-1]:\n count += 1\n return count\n"}} {"submissionId":"cmsuj0v3l00k7g4p2cy230r5x","title":"Submission 230R5X","payload":{"test_cases":[{"input":[[1,5,10,25],30],"output":true},{"input":[[2,4,6],5],"output":false},{"input":[[3,3,3],9],"output":true},{"input":[[],0],"output":true}],"constraints":"1 <= number of coins <= 20, 1 <= coin value <= 1000, 0 <= target <= 20000","time_limit_ms":500,"problem_statement":"Given a list of coin denominations you own (each coin used at most once) and a target amount, determine whether some subset of coins sums to exactly the target.","reference_solution":"def solve(coins, target):\n possible = {0}\n for c in coins:\n possible |= {p + c for p in possible}\n return target in possible\n"}} {"submissionId":"cmsuj0v3l00k8g4p2kq1ctmm2","title":"Submission 1CTMM2","payload":{"test_cases":[{"input":["+100,-30,+5"],"output":75},{"input":["-10,-20,-30"],"output":-60},{"input":["+1"],"output":1},{"input":["+0,+0,-0"],"output":0}],"constraints":"1 <= number of entries <= 1000, each entry matches ^[+-]\\d+$","time_limit_ms":500,"problem_statement":"Given a string representing a simple ledger of deposits and withdrawals separated by commas (e.g. '+100,-30,+5'), compute the final balance starting from zero.","reference_solution":"def solve(ledger):\n return sum(int(x) for x in ledger.split(','))\n"}} {"submissionId":"cmsuj0v3l00k9g4p2uxndt7ts","title":"Submission NDT7TS","payload":{"test_cases":[{"input":[[[1,0,1],[1,1,0],[0,1,0]]],"output":2},{"input":[[[1,1],[0,1]]],"output":1},{"input":[[[1]]],"output":1},{"input":[[[0,1,1,0],[1,0,0,1]]],"output":2}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":500,"problem_statement":"Given a rectangular grid of 0s and 1s, return the number of rows that are palindromic (read the same left-to-right as right-to-left).","reference_solution":"def solve(grid):\n return sum(1 for row in grid if row == row[::-1])\n"}} {"submissionId":"cmsuj0v3l00kag4p27ffgcxyg","title":"Submission FGCXYG","payload":{"test_cases":[{"input":[[["Alice","Eng"],["Bob","Sales"],["Carl","Eng"]]],"output":{"Eng":2,"Sales":1}},{"input":[[["A","X"]]],"output":{"X":1}},{"input":[[["A","Z"],["B","Y"],["C","Z"],["D","Y"],["E","Y"]]],"output":{"Y":3,"Z":2}},{"input":[[]],"output":{}}],"constraints":"1 <= number of employees <= 5000","time_limit_ms":500,"problem_statement":"Given a list of employee (name, department) pairs, return a dictionary mapping each department to the count of employees in it, with departments sorted alphabetically in the returned dict's key order.","reference_solution":"def solve(employees):\n counts = {}\n for name, dept in employees:\n counts[dept] = counts.get(dept, 0) + 1\n return {k: counts[k] for k in sorted(counts)}\n"}} {"submissionId":"cmsv5byo2015yg4p2x69xubgl","title":"Submission 9XUBGL","payload":{"test_cases":[{"input":[0],"output":1},{"input":[5],"output":3},{"input":[10],"output":27},{"input":[100],"output":648}],"constraints":"0 <= n <= 500","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n (0 <= n <= 500), compute the sum of the decimal digits of n! (n factorial).","reference_solution":"from math import factorial\n\ndef solve(n):\n return sum(int(d) for d in str(factorial(n)))\n"}} {"submissionId":"cmsv5c8kj015zg4p2vuviunfq","title":"Submission VIUNFQ","payload":{"test_cases":[{"input":[132],"output":6},{"input":[0],"output":0},{"input":[999],"output":9},{"input":[48],"output":3}],"constraints":"0 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return its digital root: the single-digit value obtained by repeatedly summing its digits until only one digit remains.","reference_solution":"def solve(n):\n if n == 0:\n return 0\n return 1 + (n - 1) % 9\n"}} {"submissionId":"cmsv5cdw50160g4p2gi70lspu","title":"Submission 70LSPU","payload":{"test_cases":[{"input":[2],"output":true},{"input":[1],"output":false},{"input":[17],"output":true},{"input":[100],"output":false},{"input":[97],"output":true}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given an integer n, determine whether it is a prime number.","reference_solution":"def solve(n):\n if n < 2:\n return False\n if n < 4:\n return True\n if n % 2 == 0:\n return False\n i = 3\n while i * i <= n:\n if n % i == 0:\n return False\n i += 2\n return True\n"}} {"submissionId":"cmsv5cizf0161g4p22rwec23b","title":"Submission WEC23B","payload":{"test_cases":[{"input":[123],"output":321},{"input":[-456],"output":-654},{"input":[100],"output":1},{"input":[0],"output":0}],"constraints":"-2^31 <= n <= 2^31 - 1","time_limit_ms":500,"problem_statement":"Given a signed 32-bit integer, return the integer with its digits reversed. Preserve the original sign.","reference_solution":"def solve(n):\n sign = -1 if n < 0 else 1\n rev = int(str(abs(n))[::-1])\n return sign * rev\n"}} {"submissionId":"cmsv5cz0k0162g4p2v5pfqfca","title":"Submission PFQFCA","payload":{"test_cases":[{"input":["hello"],"output":2},{"input":["xyz"],"output":0},{"input":["aeiou"],"output":5},{"input":["programming"],"output":3}],"constraints":"1 <= len(s) <= 10^5, s contains only lowercase English letters","time_limit_ms":500,"problem_statement":"Given a lowercase string s, count the number of vowel characters (a, e, i, o, u) it contains.","reference_solution":"def solve(s):\n return sum(1 for c in s if c in 'aeiou')\n"}} {"submissionId":"cmsv5dbke0163g4p282t5qvwj","title":"Submission T5QVWJ","payload":{"test_cases":[{"input":[0],"output":0},{"input":[1],"output":1},{"input":[10],"output":55},{"input":[20],"output":6765}],"constraints":"0 <= n <= 40","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return the n-th Fibonacci number, where fib(0) = 0 and fib(1) = 1.","reference_solution":"def solve(n):\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n"}} {"submissionId":"cmsv5doqj0164g4p2aswcx5j2","title":"Submission WCX5J2","payload":{"test_cases":[{"input":[[2,4,6,8],2],"output":5},{"input":[[3,6,9],3],"output":3},{"input":[[5],5],"output":0},{"input":[[10,20,30,40],10],"output":5}],"constraints":"1 <= n <= 2000, 1 <= a[i] <= 10^6, 1 <= k <= 10^6","time_limit_ms":1000,"problem_statement":"Given an array of n positive integers and an integer k, count the number of pairs (i, j) with 1 <= i < j <= n such that gcd(a[i], a[j]) equals k exactly.","reference_solution":"from math import gcd\n\ndef solve(arr, k):\n n = len(arr)\n count = 0\n for i in range(n):\n for j in range(i + 1, n):\n if gcd(arr[i], arr[j]) == k:\n count += 1\n return count\n"}} {"submissionId":"cmsv5dxwe0165g4p22ax9o2mp","title":"Submission X9O2MP","payload":{"test_cases":[{"input":[4,6],"output":12},{"input":[21,6],"output":42},{"input":[5,5],"output":5},{"input":[1,10],"output":10}],"constraints":"1 <= a, b <= 10^6","time_limit_ms":500,"problem_statement":"Given two positive integers a and b, return their least common multiple (the smallest positive integer divisible by both).","reference_solution":"def solve(a, b):\n def gcd(x, y):\n while y:\n x, y = y, x % y\n return x\n return a * b // gcd(a, b)\n"}} {"submissionId":"cmsv5eal90166g4p2dqgbq4qh","title":"Submission GBQ4QH","payload":{"test_cases":[{"input":[121],"output":true},{"input":[123],"output":false},{"input":[0],"output":true},{"input":[12321],"output":true}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, determine whether it reads the same forwards and backwards (a numeric palindrome).","reference_solution":"def solve(n):\n s = str(n)\n return s == s[::-1]\n"}} {"submissionId":"cmsv5en550167g4p2psjilvzf","title":"Submission JILVZF","payload":{"test_cases":[{"input":[[3,1,4,1,5,9,2,6]],"output":9},{"input":[[-5,-2,-9]],"output":-2},{"input":[[7]],"output":7}],"constraints":"1 <= len(nums) <= 10^5, -10^9 <= nums[i] <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the maximum value in the list.","reference_solution":"def solve(nums):\n m = nums[0]\n for x in nums:\n if x > m:\n m = x\n return m\n"}} {"submissionId":"cmsv5ezu50168g4p2ejrowjkq","title":"Submission ROWJKQ","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":3},{"input":[[5,5,4]],"output":4},{"input":[[10,10,9,9,8]],"output":9}],"constraints":"2 <= len(nums) <= 10^5, at least two distinct values present","time_limit_ms":500,"problem_statement":"Given a list of integers, return the second largest distinct value. It is guaranteed the list has at least two distinct values.","reference_solution":"def solve(nums):\n distinct = sorted(set(nums), reverse=True)\n return distinct[1]\n"}} {"submissionId":"cmsv5fchi0169g4p2kjllvjje","title":"Submission LLVJJE","payload":{"test_cases":[{"input":[[1,2,2,3,2],2],"output":3},{"input":[[1,2,3],5],"output":0},{"input":[[],1],"output":0}],"constraints":"0 <= len(nums) <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers and a target value, count how many times the target appears in the list.","reference_solution":"def solve(nums, target):\n return nums.count(target)\n"}} {"submissionId":"cmsv5fp87016ag4p29mnozupy","title":"Submission NOZUPY","payload":{"test_cases":[{"input":[[1,2,3]],"output":6},{"input":[[]],"output":0},{"input":[[-1,-2,3]],"output":0},{"input":[[100,200,300]],"output":600}],"constraints":"0 <= len(nums) <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of all elements.","reference_solution":"def solve(nums):\n total = 0\n for x in nums:\n total += x\n return total\n"}} {"submissionId":"cmsv5g2jz016bg4p2d7xig1yb","title":"Submission XIG1YB","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["abc","cab"],"output":true}],"constraints":"1 <= len(s1), len(s2) <= 10^5, lowercase letters only","time_limit_ms":500,"problem_statement":"Given two strings, determine whether they are anagrams of each other (contain exactly the same characters with the same multiplicities, ignoring order).","reference_solution":"def solve(s1, s2):\n return sorted(s1) == sorted(s2)\n"}} {"submissionId":"cmsv5gfg9016cg4p2c74bq496","title":"Submission 4BQ496","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],0],"output":[1,2,3]},{"input":[[1,2],3],"output":[2,1]}],"constraints":"1 <= len(nums) <= 10^5, 0 <= k <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers and a non-negative integer k, rotate the list to the right by k steps and return the new list.","reference_solution":"def solve(nums, k):\n n = len(nums)\n if n == 0:\n return nums\n k = k % n\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsv5gs6z016dg4p2ddfb5ya4","title":"Submission FB5YA4","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[1,2,3,4]},{"input":[[[1],[2],[3]]],"output":[1,2,3]},{"input":[[[1,2,3]]],"output":[1,2,3]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":500,"problem_statement":"Given a 2D matrix represented as a list of rows, flatten it into a single list in row-major order.","reference_solution":"def solve(matrix):\n result = []\n for row in matrix:\n for x in row:\n result.append(x)\n return result\n"}} {"submissionId":"cmsv5h4l3016eg4p2kzoumwui","title":"Submission OUMWUI","payload":{"test_cases":[{"input":["hello world"],"output":2},{"input":[" a b c "],"output":3},{"input":["single"],"output":1}],"constraints":"1 <= len(s) <= 10^5","time_limit_ms":500,"problem_statement":"Given a sentence string, count the number of whitespace-separated words in it.","reference_solution":"def solve(s):\n return len(s.split())\n"}} {"submissionId":"cmsv5hhxr016fg4p2z5zbus4j","title":"Submission ZBUS4J","payload":{"test_cases":[{"input":[[1,2,4,5]],"output":3},{"input":[[2,3,4,5]],"output":1},{"input":[[1,2,3,4]],"output":5}],"constraints":"1 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list containing n distinct integers taken from the range 1 to n+1 with exactly one missing, find the missing number.","reference_solution":"def solve(nums):\n n = len(nums) + 1\n total = n * (n + 1) // 2\n return total - sum(nums)\n"}} {"submissionId":"cmsv5huub016gg4p251h32ya7","title":"Submission H32YA7","payload":{"test_cases":[{"input":[[2,7,11,15],9],"output":[0,1]},{"input":[[3,2,4],6],"output":[1,2]},{"input":[[3,3],6],"output":[0,1]}],"constraints":"2 <= len(nums) <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers and a target sum, return the indices (0-indexed, ascending order) of the two elements that add up to the target. Exactly one valid pair is guaranteed to exist.","reference_solution":"def solve(nums, target):\n seen = {}\n for i, x in enumerate(nums):\n need = target - x\n if need in seen:\n return sorted([seen[need], i])\n seen[x] = i\n return []\n"}} {"submissionId":"cmsv5i8fd016hg4p2kxfky5uh","title":"Submission FKY5UH","payload":{"test_cases":[{"input":[[1,1,2,2,3]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[1,1,1]],"output":[1]}],"constraints":"0 <= len(nums) <= 10^5, nums is sorted ascending","time_limit_ms":500,"problem_statement":"Given a sorted list of integers, remove duplicates conceptually and return the list of distinct values preserving order.","reference_solution":"def solve(nums):\n result = []\n for x in nums:\n if not result or result[-1] != x:\n result.append(x)\n return result\n"}} {"submissionId":"cmsv5ils1016ig4p2p9emdrf1","title":"Submission EMDRF1","payload":{"test_cases":[{"input":["abc",1],"output":"bcd"},{"input":["xyz",3],"output":"abc"},{"input":["hello",0],"output":"hello"}],"constraints":"1 <= len(s) <= 10^5, 0 <= k <= 25, lowercase letters only","time_limit_ms":500,"problem_statement":"Given a lowercase string s and a shift amount k, apply a Caesar cipher: shift each letter forward by k positions in the alphabet, wrapping from 'z' back to 'a'.","reference_solution":"def solve(s, k):\n result = []\n for c in s:\n shifted = (ord(c) - ord('a') + k) % 26\n result.append(chr(shifted + ord('a')))\n return ''.join(result)\n"}} {"submissionId":"cmsv5iyxt016jg4p2c60hn17u","title":"Submission 0HN17U","payload":{"test_cases":[{"input":[[[1,2,3],[4,5,6]]],"output":[[1,4],[2,5],[3,6]]},{"input":[[[1]]],"output":[[1]]},{"input":[[[1,2],[3,4]]],"output":[[1,3],[2,4]]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":500,"problem_statement":"Given a 2D matrix represented as a list of rows (all rows the same length), return its transpose as a list of rows.","reference_solution":"def solve(matrix):\n rows = len(matrix)\n cols = len(matrix[0])\n result = [[0] * rows for _ in range(cols)]\n for i in range(rows):\n for j in range(cols):\n result[j][i] = matrix[i][j]\n return result\n"}} {"submissionId":"cmsv5jbqt016kg4p27aedcnw1","title":"Submission EDCNW1","payload":{"test_cases":[{"input":[11],"output":3},{"input":[0],"output":0},{"input":[255],"output":8},{"input":[1024],"output":1}],"constraints":"0 <= n <= 2^31 - 1","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, count the number of 1 bits in its binary representation.","reference_solution":"def solve(n):\n count = 0\n while n:\n count += n & 1\n n >>= 1\n return count\n"}} {"submissionId":"cmsv5jom9016lg4p21poz6sjf","title":"Submission OZ6SJF","payload":{"test_cases":[{"input":[16],"output":true},{"input":[15],"output":false},{"input":[0],"output":true},{"input":[1000000000000],"output":true}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, determine whether it is a perfect square (the square of some non-negative integer).","reference_solution":"def solve(n):\n if n < 0:\n return False\n r = int(n ** 0.5)\n for cand in (r - 1, r, r + 1):\n if cand >= 0 and cand * cand == n:\n return True\n return False\n"}} {"submissionId":"cmsv5k1qn016mg4p2c3u44jzx","title":"Submission U44JZX","payload":{"test_cases":[{"input":[[1,3,5],[2,4,6]],"output":[1,2,3,4,5,6]},{"input":[[],[1,2]],"output":[1,2]},{"input":[[1,2],[]],"output":[1,2]}],"constraints":"0 <= len(a), len(b) <= 10^5","time_limit_ms":500,"problem_statement":"Given two sorted lists of integers, merge them into a single sorted list.","reference_solution":"def solve(a, b):\n i, j = 0, 0\n result = []\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n result.append(a[i]); i += 1\n else:\n result.append(b[j]); j += 1\n result.extend(a[i:])\n result.extend(b[j:])\n return result\n"}} {"submissionId":"cmsv5kevw016ng4p2hgv0jefo","title":"Submission V0JEFO","payload":{"test_cases":[{"input":["the quick brown fox"],"output":"quick"},{"input":["a bb ccc"],"output":"ccc"},{"input":["equal size wordz"],"output":"equal"}],"constraints":"1 <= len(s) <= 10^5","time_limit_ms":500,"problem_statement":"Given a sentence string, return the longest word in it. If multiple words tie for longest, return the one that appears first.","reference_solution":"def solve(s):\n words = s.split()\n longest = words[0]\n for w in words[1:]:\n if len(w) > len(longest):\n longest = w\n return longest\n"}} {"submissionId":"cmsv5krtm016og4p22twfvmye","title":"Submission WFVMYE","payload":{"test_cases":[{"input":[[1,2,2,3],[2,2,4]],"output":[2,2]},{"input":[[1,2],[3,4]],"output":[]},{"input":[[1,1,1],[1,1]],"output":[1,1]}],"constraints":"0 <= len(a), len(b) <= 10^5","time_limit_ms":500,"problem_statement":"Given two lists of integers, return the sorted list of their intersection, including an element as many times as it appears in both (multiset intersection).","reference_solution":"def solve(a, b):\n from collections import Counter\n ca, cb = Counter(a), Counter(b)\n result = []\n for k in ca:\n if k in cb:\n result.extend([k] * min(ca[k], cb[k]))\n return sorted(result)\n"}} {"submissionId":"cmsv6j5gt0183g4p2njjixgef","title":"Submission JIXGEF","payload":{"test_cases":[{"input":[12,18,24],"output":6},{"input":[17,5,3],"output":1},{"input":[100,25,75],"output":25},{"input":[7,7,7],"output":7}],"constraints":"1 <= a, b, c <= 10^12","time_limit_ms":500,"problem_statement":"Given three positive integers a, b, and c, return their greatest common divisor (the largest integer dividing all three exactly).","reference_solution":"import math\n\ndef solve(a, b, c):\n return math.gcd(a, math.gcd(b, c))\n"}} {"submissionId":"cmsv6jic10184g4p2xnndnwxi","title":"Submission NDNWXI","payload":{"test_cases":[{"input":[123],"output":14},{"input":[0],"output":0},{"input":[9],"output":81},{"input":[1000000],"output":1}],"constraints":"0 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return the sum of the squares of its decimal digits.","reference_solution":"def solve(n):\n return sum(int(d) ** 2 for d in str(n))\n"}} {"submissionId":"cmsv6uhk20187g4p2e5ro8bf4","title":"Submission RO8BF4","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":2},{"input":[[10,10,10]],"output":0},{"input":[[1]],"output":0},{"input":[[1,1,1,100]],"output":1}],"constraints":"1 <= len(nums) <= 1000, 1 <= nums[i] <= 10^6","time_limit_ms":1000,"problem_statement":"Given an array of positive integers, return the number of elements that are strictly greater than the average of the whole array.","reference_solution":"def solve(nums):\n avg = sum(nums) / len(nums)\n return sum(1 for x in nums if x > avg)\n"}} {"submissionId":"cmsv6uzg30188g4p25jesvego","title":"Submission ESVEGO","payload":{"test_cases":[{"input":["banana"],"output":"a"},{"input":["aabb"],"output":"a"},{"input":["z"],"output":"z"},{"input":["abcabcabc"],"output":"a"}],"constraints":"1 <= len(s) <= 10^4","time_limit_ms":1000,"problem_statement":"Given a string of lowercase letters, return the letter that appears the most times. If there is a tie, return the alphabetically smallest such letter.","reference_solution":"def solve(s):\n from collections import Counter\n counts = Counter(s)\n best = max(counts.values())\n candidates = [ch for ch, c in counts.items() if c == best]\n return min(candidates)\n"}} {"submissionId":"cmsv6vemq0189g4p2uo9qwc5j","title":"Submission 9QWC5J","payload":{"test_cases":[{"input":[12],"output":6},{"input":[1],"output":1},{"input":[17],"output":2},{"input":[36],"output":9}],"constraints":"1 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given an integer n, return the number of positive divisors of n (including 1 and n itself).","reference_solution":"def solve(n):\n count = 0\n i = 1\n while i * i <= n:\n if n % i == 0:\n count += 1 if i * i == n else 2\n i += 1\n return count\n"}} {"submissionId":"cmsv6vya5018ag4p26gat5tfs","title":"Submission AT5TFS","payload":{"test_cases":[{"input":[[70,71,69,72,72,73]],"output":3},{"input":[[5]],"output":0},{"input":[[1,2,3,4,5]],"output":4},{"input":[[5,4,3,2,1]],"output":0}],"constraints":"1 <= len(temps) <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of integers representing daily temperatures, return the number of days where the temperature was strictly higher than the previous day.","reference_solution":"def solve(temps):\n return sum(1 for i in range(1, len(temps)) if temps[i] > temps[i-1])\n"}} {"submissionId":"cmsv6x4kx018bg4p24zlwmotz","title":"Submission LWMOTZ","payload":{"test_cases":[{"input":[[1,2,3],[3,2,1]],"output":true},{"input":[[1,2,2],[1,1,2]],"output":false},{"input":[[5],[5]],"output":true},{"input":[[1,2,3],[1,2,4]],"output":false}],"constraints":"1 <= len(a) == len(b) <= 10^4","time_limit_ms":1000,"problem_statement":"Given two lists of integers of equal length, return True if they are permutations of each other (contain exactly the same multiset of values), False otherwise.","reference_solution":"def solve(a, b):\n from collections import Counter\n return Counter(a) == Counter(b)\n"}} {"submissionId":"cmsv6xigm018cg4p21orhs4mq","title":"Submission RHS4MQ","payload":{"test_cases":[{"input":["(()())"],"output":6},{"input":["(()"],"output":0},{"input":[")("],"output":0},{"input":[""],"output":0}],"constraints":"0 <= len(s) <= 10^4","time_limit_ms":1000,"problem_statement":"Given a string containing only parentheses '(' and ')', return the length of the longest prefix that is balanced (every '(' has a matching ')' and no ')' is unmatched).","reference_solution":"def solve(s):\n best = 0\n depth = 0\n for i, ch in enumerate(s):\n if ch == '(':\n depth += 1\n else:\n depth -= 1\n if depth < 0:\n break\n if depth == 0:\n best = i + 1\n return best\n"}} {"submissionId":"cmsv6xw2g018dg4p2abknha53","title":"Submission KNHA53","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],4],"output":[3,1,2]},{"input":[[1],5],"output":[1]},{"input":[[1,2,3,4],0],"output":[1,2,3,4]}],"constraints":"1 <= len(nums) <= 1000, 0 <= k <= 10^6","time_limit_ms":1000,"problem_statement":"Given an integer array, rotate it to the right by k steps and return the rotated array (k may be larger than the array length).","reference_solution":"def solve(nums, k):\n n = len(nums)\n k = k % n\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsv6y94w018eg4p2c3k80r1u","title":"Submission K80R1U","payload":{"test_cases":[{"input":["Let us code"],"output":"teL su edoc"},{"input":["hello"],"output":"olleh"},{"input":["a b c"],"output":"a b c"},{"input":["ab cd ef"],"output":"ba dc fe"}],"constraints":"1 <= len(s) <= 10^4, words separated by single spaces, no leading/trailing spaces","time_limit_ms":1000,"problem_statement":"Given a sentence (words separated by single spaces), return the sentence with each word's letters reversed, but word order and spacing preserved.","reference_solution":"def solve(s):\n return ' '.join(w[::-1] for w in s.split(' '))\n"}} {"submissionId":"cmsv6ymvg018fg4p2urqh3awk","title":"Submission QH3AWK","payload":{"test_cases":[{"input":[[5,2,6,1]],"output":[2,1,1,0]},{"input":[[1,2,3]],"output":[0,0,0]},{"input":[[3,2,1]],"output":[2,1,0]},{"input":[[1]],"output":[0]}],"constraints":"1 <= len(nums) <= 500","time_limit_ms":1000,"problem_statement":"Given a list of integers, return a new list where every element is replaced by the count of elements to its right that are smaller than it.","reference_solution":"def solve(nums):\n n = len(nums)\n result = []\n for i in range(n):\n result.append(sum(1 for j in range(i+1, n) if nums[j] < nums[i]))\n return result\n"}} {"submissionId":"cmsv6z0ip018gg4p22f2pgi37","title":"Submission 2PGI37","payload":{"test_cases":[{"input":[27],"output":true},{"input":[1],"output":true},{"input":[10],"output":false},{"input":[45],"output":false}],"constraints":"1 <= n <= 10^15","time_limit_ms":1000,"problem_statement":"Given a positive integer n, return True if n is a power of three (i.e., n = 3^k for some non-negative integer k), False otherwise.","reference_solution":"def solve(n):\n if n < 1:\n return False\n while n % 3 == 0:\n n //= 3\n return n == 1\n"}} {"submissionId":"cmsv6zf1y018ig4p22o6dbmyt","title":"Submission 6DBMYT","payload":{"test_cases":[{"input":[[1,3,2,4]],"output":true},{"input":[[1,2,3]],"output":false},{"input":[[5]],"output":true},{"input":[[1,3,2,2]],"output":false}],"constraints":"0 <= len(nums) <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of integers, return True if the list is a valid 'zigzag' sequence, meaning each element alternates strictly greater-than and strictly less-than the previous one. A list of length 1 or 0 is trivially a zigzag.","reference_solution":"def solve(nums):\n n = len(nums)\n if n <= 2:\n return True\n up = nums[1] > nums[0]\n for i in range(2, n):\n cur_up = nums[i] > nums[i-1]\n if nums[i] == nums[i-1] or cur_up == up:\n return False\n up = cur_up\n return True\n"}} {"submissionId":"cmsv6zthb018kg4p2co7qupa1","title":"Submission 7QUPA1","payload":{"test_cases":[{"input":[5],"output":1},{"input":[25],"output":6},{"input":[0],"output":0},{"input":[10],"output":2}],"constraints":"0 <= n <= 10^6","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return the number of trailing zeros in n! (n factorial).","reference_solution":"def solve(n):\n count = 0\n p = 5\n while p <= n:\n count += n // p\n p *= 5\n return count\n"}} {"submissionId":"cmsv707rt018og4p2oonb9flu","title":"Submission NB9FLU","payload":{"test_cases":[{"input":[[[0,30],[5,10],[15,20]]],"output":2},{"input":[[[7,10],[2,4]]],"output":1},{"input":[[[1,5],[2,6],[3,7]]],"output":3},{"input":[[[1,2]]],"output":1}],"constraints":"1 <= len(intervals) <= 10^4, intervals given as [start, end] with start < end","time_limit_ms":1000,"problem_statement":"Given a list of meeting intervals as [start, end] pairs (not necessarily sorted), return the minimum number of meeting rooms required so that no two overlapping meetings share a room.","reference_solution":"def solve(intervals):\n starts = sorted(i[0] for i in intervals)\n ends = sorted(i[1] for i in intervals)\n rooms = 0\n max_rooms = 0\n si = ei = 0\n n = len(intervals)\n while si < n:\n if starts[si] < ends[ei]:\n rooms += 1\n si += 1\n max_rooms = max(max_rooms, rooms)\n else:\n rooms -= 1\n ei += 1\n return max_rooms\n"}} {"submissionId":"cmsv70l5t018tg4p25ibmavpi","title":"Submission BMAVPI","payload":{"test_cases":[{"input":["carrace"],"output":true},{"input":["hello"],"output":false},{"input":["a"],"output":true},{"input":["aabbcc"],"output":true}],"constraints":"1 <= len(s) <= 10^4, lowercase letters only","time_limit_ms":1000,"problem_statement":"Given a string, return True if it can be rearranged to form a palindrome (allowing at most one character with an odd count), False otherwise.","reference_solution":"def solve(s):\n from collections import Counter\n counts = Counter(s)\n odd = sum(1 for c in counts.values() if c % 2 == 1)\n return odd <= 1\n"}} {"submissionId":"cmsv70zyu018zg4p2by31yf9m","title":"Submission 31YF9M","payload":{"test_cases":[{"input":[[7,1,5,3,6,4]],"output":5},{"input":[[7,6,4,3,1]],"output":0},{"input":[[1,2]],"output":1},{"input":[[5]],"output":0}],"constraints":"1 <= len(prices) <= 10^5, 0 <= prices[i] <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of stock prices where prices[i] is the price on day i, return the maximum profit achievable from at most one buy and one sell (buy before sell). Return 0 if no profit is possible.","reference_solution":"def solve(prices):\n min_price = float('inf')\n best = 0\n for p in prices:\n if p < min_price:\n min_price = p\n elif p - min_price > best:\n best = p - min_price\n return best\n"}} {"submissionId":"cmsv71d110196g4p2y8tt2ilz","title":"Submission TT2ILZ","payload":{"test_cases":[{"input":[[1,1,2,2,2,3]],"output":3},{"input":[[1]],"output":1},{"input":[[1,2,3]],"output":1},{"input":[[5,5,5,5]],"output":4}],"constraints":"1 <= len(nums) <= 10^5","time_limit_ms":1000,"problem_statement":"Given an integer array, return the length of the longest run of consecutive equal elements.","reference_solution":"def solve(nums):\n best = cur = 1\n for i in range(1, len(nums)):\n if nums[i] == nums[i-1]:\n cur += 1\n best = max(best, cur)\n else:\n cur = 1\n return best\n"}} {"submissionId":"cmsv71sfp019dg4p2o7t47f2w","title":"Submission T47F2W","payload":{"test_cases":[{"input":["123","456"],"output":"579"},{"input":["999","1"],"output":"1000"},{"input":["0","0"],"output":"0"},{"input":["100000000000000000000","1"],"output":"100000000000000000001"}],"constraints":"1 <= len(a), len(b) <= 200, digit strings with no leading zeros unless the value is '0'","time_limit_ms":1000,"problem_statement":"Given two positive integers represented as strings (which may be too large for native integer overflow in other languages), return their sum as a string.","reference_solution":"def solve(a, b):\n return str(int(a) + int(b))\n"}} {"submissionId":"cmsv7286o019lg4p2y1q4n3zu","title":"Submission Q4N3ZU","payload":{"test_cases":[{"input":[[2,7,11,15],9],"output":true},{"input":[[1,2,3],7],"output":false},{"input":[[3,3],6],"output":true},{"input":[[1],2],"output":false}],"constraints":"1 <= len(nums) <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of integers, return True if there exist two distinct indices i and j such that nums[i] + nums[j] equals a given target, False otherwise.","reference_solution":"def solve(nums, target):\n seen = set()\n for n in nums:\n if target - n in seen:\n return True\n seen.add(n)\n return False\n"}} {"submissionId":"cmsv72lsj019ug4p2qyequufm","title":"Submission EQUUFM","payload":{"test_cases":[{"input":[[[1,2,3],[4,5,6]]],"output":[[1,4],[2,5],[3,6]]},{"input":[[[1]]],"output":[[1]]},{"input":[[[1,2],[3,4]]],"output":[[1,3],[2,4]]},{"input":[[[1,2,3]]],"output":[[1],[2],[3]]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":1000,"problem_statement":"Given a matrix of integers represented as a list of rows, return its transpose (rows become columns).","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix)]\n"}} {"submissionId":"cmsv73tn601a2g4p2uydrxk56","title":"Submission DRXK56","payload":{"test_cases":[{"input":[[1,2,3,1],3],"output":true},{"input":[[1,0,1,1],1],"output":true},{"input":[[1,2,3,1,2,3],2],"output":false},{"input":[[1],0],"output":false}],"constraints":"1 <= len(nums) <= 10^5, 0 <= k <= 10^5","time_limit_ms":1000,"problem_statement":"Given an integer array and an integer k, return True if the array contains two distinct indices i and j such that nums[i] == nums[j] and the absolute difference between i and j is at most k.","reference_solution":"def solve(nums, k):\n last_seen = {}\n for i, n in enumerate(nums):\n if n in last_seen and i - last_seen[n] <= k:\n return True\n last_seen[n] = i\n return False\n"}} {"submissionId":"cmsv96th001j2g4p2juw3ppsu","title":"Submission W3PPSU","payload":{"test_cases":[{"input":[[[1,1,0],[1,1,1],[0,1,0]]],"output":3},{"input":[[[0,0],[0,0]]],"output":0},{"input":[[]],"output":0},{"input":[[[1]]],"output":1},{"input":[[[1,0,1],[1,0,1],[1,0,1]]],"output":3}],"constraints":"0 <= rows <= 500, 0 <= cols <= 500, every cell is 0 or 1. The grid may be empty or have empty rows.","time_limit_ms":1000,"problem_statement":"A rectangular grid of 0s and 1s represents a warehouse floor, where 1 marks a clear tile. A robot may park a straight shelf either fully horizontally or fully vertically, occupying consecutive clear tiles in a single row or a single column. Return the length of the longest shelf that fits. Return 0 if the grid is empty or contains no clear tile.","reference_solution":"def solve(grid):\n if not grid or not grid[0]:\n return 0\n rows, cols = len(grid), len(grid[0])\n best = 0\n for r in range(rows):\n run = 0\n for c in range(cols):\n run = run + 1 if grid[r][c] == 1 else 0\n if run > best:\n best = run\n for c in range(cols):\n run = 0\n for r in range(rows):\n run = run + 1 if grid[r][c] == 1 else 0\n if run > best:\n best = run\n return best\n"}} {"submissionId":"cmsv96th001j3g4p28l7obh9s","title":"Submission 7OBH9S","payload":{"test_cases":[{"input":[[["Ana",30],[" ana ",-10],["BEN",5],["ben",-9],["Cy",7]]],"output":[["ana",20],["cy",7]]},{"input":[[]],"output":[]},{"input":[[["Zed",4],["Amy",4]]],"output":[["amy",4],["zed",4]]},{"input":[[["Sol",-3]]],"output":[]}],"constraints":"0 <= number of entries <= 10^4, -10^6 <= amount <= 10^6, names are non-empty after trimming.","time_limit_ms":1000,"problem_statement":"A shared expense log holds entries of (person, amount), where a positive amount is money the person still owes and a negative amount is a repayment they made. Names may differ in capitalisation and surrounding whitespace but refer to the same person. Return the people who still owe money after netting, as [name, total] pairs using the lowercase trimmed name, sorted by amount descending and then by name ascending. Exclude anyone whose net total is zero or negative.","reference_solution":"def solve(receipts):\n totals = {}\n for name, amount in receipts:\n key = name.strip().lower()\n totals[key] = totals.get(key, 0) + amount\n owed = [[k, v] for k, v in totals.items() if v > 0]\n owed.sort(key=lambda kv: (-kv[1], kv[0]))\n return owed\n"}} {"submissionId":"cmsv96th001j4g4p2l0sgh9lj","title":"Submission SGH9LJ","payload":{"test_cases":[{"input":[[10,20,30,40],2],"output":[15,25,35]},{"input":[[5],1],"output":[5]},{"input":[[1,2,3],5],"output":[]},{"input":[[1,2,3],0],"output":[]},{"input":[[-4,0,4,8,12],3],"output":[0,4,8]}],"constraints":"0 <= number of days <= 10^5, -100 <= temperature <= 100, window may be any integer including zero or negative.","time_limit_ms":1000,"problem_statement":"Given a list of daily temperatures and a window size, return the rolling average over every consecutive window, each value rounded to two decimal places. The first output covers days 0 through window-1, the next covers days 1 through window, and so on. Return an empty list if the window is not a positive number no larger than the list length.","reference_solution":"def solve(temps, window):\n if window <= 0 or window > len(temps):\n return []\n out = []\n total = sum(temps[:window])\n out.append(round(total / window, 2))\n for i in range(window, len(temps)):\n total += temps[i] - temps[i - window]\n out.append(round(total / window, 2))\n return out\n"}} {"submissionId":"cmsv96th001j5g4p2b7z0ymc8","title":"Submission Z0YMC8","payload":{"test_cases":[{"input":["Hello, World! 42"],"output":{"other":4,"digits":2,"vowels":3,"consonants":7}},{"input":[""],"output":{"other":0,"digits":0,"vowels":0,"consonants":0}},{"input":["aeiouAEIOU"],"output":{"other":0,"digits":0,"vowels":10,"consonants":0}},{"input":["12345"],"output":{"other":0,"digits":5,"vowels":0,"consonants":0}},{"input":[" \t"],"output":{"other":3,"digits":0,"vowels":0,"consonants":0}}],"constraints":"0 <= length <= 10^5, the string may contain any Unicode characters.","time_limit_ms":1000,"problem_statement":"Classify every character of a string into exactly one of four buckets and return the counts as a dictionary with keys 'vowels', 'consonants', 'digits' and 'other'. A character is a vowel if it is one of a, e, i, o, u in either case; any other alphabetic character is a consonant; decimal digits count as digits; everything else, including spaces and punctuation, is other. Non-ASCII letters count as consonants unless they are one of the five listed vowels.","reference_solution":"def solve(text):\n vowels = set('aeiou')\n counts = {'vowels': 0, 'consonants': 0, 'digits': 0, 'other': 0}\n for ch in text:\n low = ch.lower()\n if low.isalpha():\n if low in vowels:\n counts['vowels'] += 1\n else:\n counts['consonants'] += 1\n elif ch.isdigit():\n counts['digits'] += 1\n else:\n counts['other'] += 1\n return counts\n"}} {"submissionId":"cmsv96th001j6g4p2xpwv2jni","title":"Submission WV2JNI","payload":{"test_cases":[{"input":["NNEESSWW"],"output":[0,0,1]},{"input":[""],"output":[0,0,0]},{"input":["NSNSNS"],"output":[0,0,5]},{"input":["NEqSW"],"output":[0,0,1]},{"input":["EEEE"],"output":[4,0,0]}],"constraints":"0 <= length of the command string <= 10^5, the string may contain arbitrary characters.","time_limit_ms":1000,"problem_statement":"A drone starts at the origin facing no particular direction and follows a command string. The letters N, S, E and W move it one unit north, south, east or west respectively; any other character is a malformed command and must be ignored without moving the drone. Return [x, y, revisits] where x and y are the final coordinates and revisits counts how many times the drone arrived at a position it had already occupied, counting the starting origin as already occupied.","reference_solution":"def solve(steps):\n x = y = 0\n seen = {(0, 0)}\n revisits = 0\n moves = {'N': (0, 1), 'S': (0, -1), 'E': (1, 0), 'W': (-1, 0)}\n for ch in steps:\n if ch not in moves:\n continue\n dx, dy = moves[ch]\n x += dx\n y += dy\n if (x, y) in seen:\n revisits += 1\n else:\n seen.add((x, y))\n return [x, y, revisits]\n"}} {"submissionId":"cmsvhr9cy01urg4p2cxyb8snk","title":"Submission YB8SNK","payload":{"test_cases":[{"input":[[3,2,3]],"output":3},{"input":[[2,2,1,1,1,2,2]],"output":2},{"input":[[1]],"output":1},{"input":[[5,5,5,1,2,5,5]],"output":5}],"constraints":"1 <= n <= 10^5, -10^9 <= value <= 10^9, a majority element (appearing > n/2 times) is guaranteed to exist in the input","time_limit_ms":500,"problem_statement":"Given an array of integers where a value appears more than n/2 times (a 'majority element' is guaranteed to exist), return that value.","reference_solution":"def solve(nums):\n count = 0\n candidate = None\n for n in nums:\n if count == 0:\n candidate = n\n count += 1 if n == candidate else -1\n return candidate\n"}} {"submissionId":"cmsvo23y80240g4p2zmdvywl6","title":"Submission DVYWL6","payload":{"test_cases":[{"input":[[1,2,3]],"output":6},{"input":[[]],"output":0},{"input":[[-1,1]],"output":0},{"input":[[100]],"output":100}],"constraints":"0 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return the sum of all elements.","reference_solution":"def solve(nums):\n return sum(nums)\n"}} {"submissionId":"cmsvo23y80241g4p2gg5kzxm2","title":"Submission 5KZXM2","payload":{"test_cases":[{"input":[0],"output":1},{"input":[1],"output":1},{"input":[5],"output":120},{"input":[10],"output":3628800}],"constraints":"0 <= n <= 20","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return n factorial (n!).","reference_solution":"def solve(n):\n result = 1\n for i in range(2, n + 1):\n result *= i\n return result\n"}} {"submissionId":"cmsvo23y80242g4p2s0ivs5pp","title":"Submission IVS5PP","payload":{"test_cases":[{"input":[2],"output":true},{"input":[1],"output":false},{"input":[17],"output":true},{"input":[18],"output":false}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer n, return True if it is a prime number, otherwise False.","reference_solution":"def solve(n):\n if n < 2:\n return False\n for i in range(2, int(n ** 0.5) + 1):\n if n % i == 0:\n return False\n return True\n"}} {"submissionId":"cmsvo23y80243g4p2eq6cgv6d","title":"Submission 6CGV6D","payload":{"test_cases":[{"input":["hello","l"],"output":2},{"input":["","a"],"output":0},{"input":["aaa","a"],"output":3},{"input":["Hello","h"],"output":0}],"constraints":"0 <= len(s) <= 10^5","time_limit_ms":500,"problem_statement":"Given a string s and a single character c, return the number of times c appears in s (case-sensitive).","reference_solution":"def solve(s, c):\n return s.count(c)\n"}} {"submissionId":"cmsvo23y80244g4p2vauz26ck","title":"Submission UZ26CK","payload":{"test_cases":[{"input":[12,18],"output":6},{"input":[17,5],"output":1},{"input":[0,5],"output":5},{"input":[100,75],"output":25}],"constraints":"0 <= a, b <= 10^9","time_limit_ms":500,"problem_statement":"Given two non-negative integers a and b, return their greatest common divisor.","reference_solution":"def solve(a, b):\n while b:\n a, b = b, a % b\n return a\n"}} {"submissionId":"cmsvo23y80245g4p21ihty7bs","title":"Submission HTY7BS","payload":{"test_cases":[{"input":["Hello World"],"output":2},{"input":[""],"output":0},{"input":["ALLCAPS"],"output":7},{"input":["nocaps"],"output":0}],"constraints":"0 <= len(s) <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the number of uppercase letters it contains.","reference_solution":"def solve(s):\n return sum(1 for c in s if c.isupper())\n"}} {"submissionId":"cmsvo23y80246g4p2nl2lq0kh","title":"Submission 2LQ0KH","payload":{"test_cases":[{"input":[[1,2,3]],"output":2},{"input":[[1,2]],"output":1.5},{"input":[[10]],"output":10},{"input":[[1,2,4]],"output":2.33}],"constraints":"1 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given a non-empty array of numbers, return their average rounded to 2 decimal places.","reference_solution":"def solve(nums):\n return round(sum(nums) / len(nums), 2)\n"}} {"submissionId":"cmsvo23y80247g4p2jbb81zhk","title":"Submission B81ZHK","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["Dormitory","Dirty Room"],"output":true},{"input":["",""],"output":true}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two strings, determine whether they are anagrams of each other, ignoring case and spaces.","reference_solution":"def solve(a, b):\n norm = lambda s: sorted(s.replace(' ', '').lower())\n return norm(a) == norm(b)\n"}} {"submissionId":"cmsvo23y80248g4p2boj4hcz8","title":"Submission J4HCZ8","payload":{"test_cases":[{"input":[[2,1,5,1,3,2],3],"output":9},{"input":[[1,2,3],5],"output":0},{"input":[[5],1],"output":5},{"input":[[-1,-2,-3],2],"output":-3}],"constraints":"1 <= k <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers and an integer k, return the maximum sum of any contiguous subarray of length exactly k. Return 0 if k is larger than the array length.","reference_solution":"def solve(nums, k):\n if k > len(nums):\n return 0\n window = sum(nums[:k])\n best = window\n for i in range(k, len(nums)):\n window += nums[i] - nums[i - k]\n best = max(best, window)\n return best\n"}} {"submissionId":"cmsvo23y80249g4p2309znh2r","title":"Submission 9ZNH2R","payload":{"test_cases":[{"input":[5],"output":1},{"input":[10],"output":2},{"input":[25],"output":6},{"input":[0],"output":0}],"constraints":"0 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return the number of trailing zeros in n factorial.","reference_solution":"def solve(n):\n count = 0\n power = 5\n while power <= n:\n count += n // power\n power *= 5\n return count\n"}} {"submissionId":"cmsvp93ur02cwg4p22x2hasqf","title":"Submission 2HASQF","payload":{"test_cases":[{"input":[[2,3,4]],"output":24},{"input":[[]],"output":1},{"input":[[0,5,3]],"output":0},{"input":[[-1,-2,3]],"output":6}],"constraints":"0 <= n <= 20, -10 <= value <= 10","time_limit_ms":500,"problem_statement":"Given an array of integers, return the product of all elements. An empty array has product 1.","reference_solution":"def solve(nums):\n p = 1\n for x in nums:\n p *= x\n return p\n"}} {"submissionId":"cmsvp93ur02cxg4p2ab13tqza","title":"Submission 13TQZA","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":5},{"input":[[-5,-1,-10]],"output":-1},{"input":[[7]],"output":7},{"input":[[2,2,2]],"output":2}],"constraints":"1 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return the largest element.","reference_solution":"def solve(nums):\n return max(nums)\n"}} {"submissionId":"cmsvp93ur02cyg4p2p5jbolwm","title":"Submission JBOLWM","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":1},{"input":[[-5,-1,-10]],"output":-10},{"input":[[7]],"output":7},{"input":[[2,2,2]],"output":2}],"constraints":"1 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return the smallest element.","reference_solution":"def solve(nums):\n return min(nums)\n"}} {"submissionId":"cmsvp93ur02czg4p2jt6g34fv","title":"Submission 6G34FV","payload":{"test_cases":[{"input":[[1,-2,3,-4,5]],"output":3},{"input":[[]],"output":0},{"input":[[-1,-2,-3]],"output":0},{"input":[[0,0,1]],"output":1}],"constraints":"0 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return how many are strictly positive.","reference_solution":"def solve(nums):\n return sum(1 for x in nums if x > 0)\n"}} {"submissionId":"cmsvp93ur02d0g4p2s9a6tlil","title":"Submission A6TLIL","payload":{"test_cases":[{"input":[[1,-2,3,-4,5]],"output":2},{"input":[[]],"output":0},{"input":[[-1,-2,-3]],"output":3},{"input":[[0,0,1]],"output":0}],"constraints":"0 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return how many are strictly negative.","reference_solution":"def solve(nums):\n return sum(1 for x in nums if x < 0)\n"}} {"submissionId":"cmsvp93ur02d1g4p23k7ww4oj","title":"Submission 7WW4OJ","payload":{"test_cases":[{"input":[[1,2,3,4,5,6]],"output":3},{"input":[[]],"output":0},{"input":[[-2,-4,3]],"output":2},{"input":[[1,3,5]],"output":0}],"constraints":"0 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return how many are even.","reference_solution":"def solve(nums):\n return sum(1 for x in nums if x % 2 == 0)\n"}} {"submissionId":"cmsvp93ur02d2g4p2k2fqut6e","title":"Submission FQUT6E","payload":{"test_cases":[{"input":[[1,2,3,4,5,6]],"output":3},{"input":[[]],"output":0},{"input":[[-2,-4,3]],"output":1},{"input":[[1,3,5]],"output":3}],"constraints":"0 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return how many are odd.","reference_solution":"def solve(nums):\n return sum(1 for x in nums if x % 2 != 0)\n"}} {"submissionId":"cmsvp93ur02d3g4p2q73lb0tn","title":"Submission 3LB0TN","payload":{"test_cases":[{"input":["hello"],"output":"olleh"},{"input":[""],"output":""},{"input":["a"],"output":"a"},{"input":["racecar"],"output":"racecar"}],"constraints":"0 <= len(s) <= 10^4","time_limit_ms":500,"problem_statement":"Given a string, return the reverse of the string.","reference_solution":"def solve(s):\n return s[::-1]\n"}} {"submissionId":"cmsvp93ur02d4g4p24pezy2mo","title":"Submission EZY2MO","payload":{"test_cases":[{"input":["racecar"],"output":true},{"input":["hello"],"output":false},{"input":[""],"output":true},{"input":["a"],"output":true}],"constraints":"0 <= len(s) <= 10^4","time_limit_ms":500,"problem_statement":"Given a string, determine whether it reads the same forwards and backwards (case-sensitive, exact match).","reference_solution":"def solve(s):\n return s == s[::-1]\n"}} {"submissionId":"cmsvp93ur02d5g4p2fj63bx09","title":"Submission 63BX09","payload":{"test_cases":[{"input":["Hello World"],"output":"HELLO WORLD"},{"input":[""],"output":""},{"input":["ABC"],"output":"ABC"},{"input":["mixed123Case"],"output":"MIXED123CASE"}],"constraints":"0 <= len(s) <= 10^4","time_limit_ms":500,"problem_statement":"Given a string, return its uppercase version.","reference_solution":"def solve(s):\n return s.upper()\n"}} {"submissionId":"cmsvp93ur02d6g4p2fq3i7qs3","title":"Submission 3I7QS3","payload":{"test_cases":[{"input":["the quick brown fox"],"output":4},{"input":[""],"output":0},{"input":["single"],"output":1},{"input":[" extra spaces "],"output":2}],"constraints":"0 <= len(s) <= 10^4","time_limit_ms":500,"problem_statement":"Given a sentence, return the number of words (separated by whitespace).","reference_solution":"def solve(s):\n return len(s.split())\n"}} {"submissionId":"cmsvp93ur02d7g4p2j9ngagje","title":"Submission NGAGJE","payload":{"test_cases":[{"input":[48,18],"output":6},{"input":[0,5],"output":5},{"input":[17,13],"output":1},{"input":[100,25],"output":25}],"constraints":"0 <= a, b <= 10^9","time_limit_ms":500,"problem_statement":"Given two non-negative integers, return their greatest common divisor.","reference_solution":"def solve(a, b):\n while b:\n a, b = b, a % b\n return a\n"}} {"submissionId":"cmsvp93ur02d8g4p28d5iqq5b","title":"Submission 5IQQ5B","payload":{"test_cases":[{"input":[4,6],"output":12},{"input":[3,7],"output":21},{"input":[12,18],"output":36},{"input":[5,5],"output":5}],"constraints":"1 <= a, b <= 10^4","time_limit_ms":500,"problem_statement":"Given two positive integers, return their least common multiple.","reference_solution":"def solve(a, b):\n import math\n return a * b // math.gcd(a, b)\n"}} {"submissionId":"cmsvp93ur02d9g4p2vk1tohuv","title":"Submission 1TOHUV","payload":{"test_cases":[{"input":[7],"output":true},{"input":[1],"output":false},{"input":[97],"output":true},{"input":[100],"output":false}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer, return True if it is prime, else False.","reference_solution":"def solve(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5)+1):\n if n % i == 0:\n return False\n return True\n"}} {"submissionId":"cmsvp93ur02dbg4p2fqtn1zkd","title":"Submission TN1ZKD","payload":{"test_cases":[{"input":[0],"output":1},{"input":[1],"output":1},{"input":[6],"output":720},{"input":[10],"output":3628800}],"constraints":"0 <= n <= 15","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return n factorial.","reference_solution":"def solve(n):\n r = 1\n for i in range(2, n+1):\n r *= i\n return r\n"}} {"submissionId":"cmsvp93ur02dcg4p206gdlad3","title":"Submission GDLAD3","payload":{"test_cases":[{"input":[1234],"output":10},{"input":[0],"output":0},{"input":[9999],"output":36},{"input":[100],"output":1}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return the sum of its decimal digits.","reference_solution":"def solve(n):\n return sum(int(d) for d in str(n))\n"}} {"submissionId":"cmsvp93ur02ddg4p24hmbszgu","title":"Submission MBSZGU","payload":{"test_cases":[{"input":[12345],"output":5},{"input":[0],"output":1},{"input":[7],"output":1},{"input":[1000000],"output":7}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return the number of digits it has.","reference_solution":"def solve(n):\n return len(str(n))\n"}} {"submissionId":"cmsvp93ur02deg4p2mror6u6o","title":"Submission OR6U6O","payload":{"test_cases":[{"input":[1234],"output":4321},{"input":[100],"output":1},{"input":[0],"output":0},{"input":[7],"output":7}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return the integer formed by reversing its digits.","reference_solution":"def solve(n):\n return int(str(n)[::-1])\n"}} {"submissionId":"cmsvp93ur02dfg4p22pde6lid","title":"Submission DE6LID","payload":{"test_cases":[{"input":[153],"output":true},{"input":[123],"output":false},{"input":[9474],"output":true},{"input":[10],"output":false}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer with k digits, determine whether it equals the sum of its digits each raised to the kth power (an Armstrong number).","reference_solution":"def solve(n):\n digits = str(n)\n k = len(digits)\n return n == sum(int(d)**k for d in digits)\n"}} {"submissionId":"cmsvp93ur02dgg4p2jsk4ghpe","title":"Submission K4GHPE","payload":{"test_cases":[{"input":[[1,2,3]],"output":14},{"input":[[]],"output":0},{"input":[[-2,2]],"output":8},{"input":[[5]],"output":25}],"constraints":"0 <= n <= 10^4, -100 <= value <= 100","time_limit_ms":500,"problem_statement":"Given an array of integers, return the sum of the squares of each element.","reference_solution":"def solve(nums):\n return sum(x*x for x in nums)\n"}} {"submissionId":"cmsvp93ur02dhg4p23uwcr6o8","title":"Submission WCR6O8","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":2.5},{"input":[[5]],"output":5},{"input":[[1,1,1]],"output":1},{"input":[[2,4,6,8]],"output":5}],"constraints":"1 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given a non-empty array of numbers, return the average as a float.","reference_solution":"def solve(nums):\n return sum(nums) / len(nums)\n"}} {"submissionId":"cmsvp93ur02dig4p2pbm8tidf","title":"Submission M8TIDF","payload":{"test_cases":[{"input":[3,1,2],"output":2},{"input":[5,5,1],"output":5},{"input":[-1,-2,-3],"output":-2},{"input":[0,0,0],"output":0}],"constraints":"any real numbers","time_limit_ms":500,"problem_statement":"Given three numbers, return the median (middle value).","reference_solution":"def solve(a, b, c):\n return sorted([a,b,c])[1]\n"}} {"submissionId":"cmsvp93ur02djg4p2k4tsuror","title":"Submission TSUROR","payload":{"test_cases":[{"input":["Hello World"],"output":"hELLO wORLD"},{"input":[""],"output":""},{"input":["ABCxyz"],"output":"abcXYZ"},{"input":["123abc"],"output":"123ABC"}],"constraints":"0 <= len(s) <= 10^4","time_limit_ms":500,"problem_statement":"Given a string, return it with the case of every letter swapped (upper becomes lower and vice versa).","reference_solution":"def solve(s):\n return s.swapcase()\n"}} {"submissionId":"cmsvp93ur02dkg4p2zbytmxem","title":"Submission YTMXEM","payload":{"test_cases":[{"input":[[1,2,2,3,1]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[1,1,1]],"output":[1]},{"input":[[5,4,3,2,1]],"output":[5,4,3,2,1]}],"constraints":"0 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given a list of integers, remove duplicates while preserving the first-seen order.","reference_solution":"def solve(nums):\n seen = set()\n result = []\n for x in nums:\n if x not in seen:\n seen.add(x)\n result.append(x)\n return result\n"}} {"submissionId":"cmsvp93ur02dmg4p2x0alrt1h","title":"Submission ALRT1H","payload":{"test_cases":[{"input":["Hello"],"output":3},{"input":[""],"output":0},{"input":["xyz"],"output":3},{"input":["AEIOU"],"output":0}],"constraints":"0 <= len(s) <= 10^4, letters only","time_limit_ms":500,"problem_statement":"Given a string of only letters, count the number of consonants (non-vowel letters), case-insensitive.","reference_solution":"def solve(s):\n return sum(1 for c in s.lower() if c.isalpha() and c not in 'aeiou')\n"}} {"submissionId":"cmsvp93ur02dng4p2jndpvfhs","title":"Submission DPVFHS","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["",""],"output":true},{"input":["abc","cab"],"output":true}],"constraints":"0 <= len(a), len(b) <= 10^4","time_limit_ms":500,"problem_statement":"Given two strings, determine if they are anagrams of each other (same letters, same frequency), case-sensitive.","reference_solution":"def solve(a, b):\n return sorted(a) == sorted(b)\n"}} {"submissionId":"cmsvp93ur02dog4p28kcb31pb","title":"Submission CB31PB","payload":{"test_cases":[{"input":["the quick brown fox"],"output":5},{"input":["a"],"output":1},{"input":["hello world"],"output":5},{"input":["x yz abcd"],"output":4}],"constraints":"1 <= len(s) <= 10^4","time_limit_ms":500,"problem_statement":"Given a sentence, return the length of the longest word.","reference_solution":"def solve(s):\n return max(len(w) for w in s.split())\n"}} {"submissionId":"cmsvp93ur02dpg4p2e4fmjckw","title":"Submission FMJCKW","payload":{"test_cases":[{"input":["hello world","world"],"output":true},{"input":["abc","xyz"],"output":false},{"input":["",""],"output":true},{"input":["abc",""],"output":true}],"constraints":"0 <= len(a), len(b) <= 10^4","time_limit_ms":500,"problem_statement":"Given two strings, determine whether the second is a substring of the first.","reference_solution":"def solve(a, b):\n return b in a\n"}} {"submissionId":"cmsvp93ur02dqg4p2u9vo1spb","title":"Submission VO1SPB","payload":{"test_cases":[{"input":["hello WORLD"],"output":"Hello World"},{"input":[""],"output":""},{"input":["a b c"],"output":"A B C"},{"input":["MIXED case TEXT"],"output":"Mixed Case Text"}],"constraints":"0 <= len(s) <= 10^4","time_limit_ms":500,"problem_statement":"Given a sentence, capitalize the first letter of every word and lowercase the rest.","reference_solution":"def solve(s):\n return ' '.join(w.capitalize() for w in s.split())\n"}} {"submissionId":"cmsvp93ur02drg4p2cgh5fbps","title":"Submission H5FBPS","payload":{"test_cases":[{"input":[9875],"output":2},{"input":[1],"output":1},{"input":[99999],"output":9},{"input":[10],"output":1}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer, repeatedly sum its digits until a single digit remains, and return that digit.","reference_solution":"def solve(n):\n while n >= 10:\n n = sum(int(d) for d in str(n))\n return n\n"}} {"submissionId":"cmsvp93ur02dsg4p206eud7pu","title":"Submission EUD7PU","payload":{"test_cases":[{"input":[16],"output":true},{"input":[15],"output":false},{"input":[0],"output":true},{"input":[1000000],"output":true}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given a non-negative integer, determine whether it is a perfect square.","reference_solution":"def solve(n):\n r = int(n**0.5)\n for x in (r-1, r, r+1):\n if x >= 0 and x*x == n:\n return True\n return False\n"}} {"submissionId":"cmsvp93ur02dtg4p2b9q2akkx","title":"Submission Q2AKKX","payload":{"test_cases":[{"input":[16],"output":true},{"input":[18],"output":false},{"input":[1],"output":true},{"input":[1024],"output":true}],"constraints":"1 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given a positive integer, determine whether it is a power of two.","reference_solution":"def solve(n):\n return n > 0 and (n & (n-1)) == 0\n"}} {"submissionId":"cmsvp93ur02dug4p2p5dvrvn6","title":"Submission DVRVN6","payload":{"test_cases":[{"input":["1010"],"output":10},{"input":["0"],"output":0},{"input":["1"],"output":1},{"input":["11111111"],"output":255}],"constraints":"1 <= len(s) <= 32","time_limit_ms":500,"problem_statement":"Given a binary string (only 0s and 1s), return its decimal value.","reference_solution":"def solve(s):\n return int(s, 2)\n"}} {"submissionId":"cmsvp93ur02dvg4p21b8fhvkt","title":"Submission 8FHVKT","payload":{"test_cases":[{"input":[10],"output":"1010"},{"input":[0],"output":"0"},{"input":[1],"output":"1"},{"input":[255],"output":"11111111"}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return its binary representation as a string with no leading zeros (except for 0 itself).","reference_solution":"def solve(n):\n return bin(n)[2:]\n"}} {"submissionId":"cmsvp93ur02dwg4p2leawzgbp","title":"Submission AWZGBP","payload":{"test_cases":[{"input":[11],"output":3},{"input":[0],"output":0},{"input":[7],"output":3},{"input":[1024],"output":1}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return the number of 1 bits in its binary representation.","reference_solution":"def solve(n):\n return bin(n).count('1')\n"}} {"submissionId":"cmsvp93ur02dxg4p23jmy5930","title":"Submission MY5930","payload":{"test_cases":[{"input":[2024],"output":true},{"input":[1900],"output":false},{"input":[2000],"output":true},{"input":[2023],"output":false}],"constraints":"1 <= year <= 9999","time_limit_ms":500,"problem_statement":"Given a year, determine whether it is a leap year (divisible by 4, but not by 100 unless also by 400).","reference_solution":"def solve(year):\n return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)\n"}} {"submissionId":"cmsvp93ur02dyg4p2scfg7l7i","title":"Submission FG7L7I","payload":{"test_cases":[{"input":[2,2024],"output":29},{"input":[2,2023],"output":28},{"input":[4,2024],"output":30},{"input":[12,2024],"output":31}],"constraints":"1 <= month <= 12, 1 <= year <= 9999","time_limit_ms":500,"problem_statement":"Given a month (1-12) and year, return the number of days in that month.","reference_solution":"def solve(month, year):\n days = [31,29 if (year%4==0 and (year%100!=0 or year%400==0)) else 28,31,30,31,30,31,31,30,31,30,31]\n return days[month-1]\n"}} {"submissionId":"cmsvp93ur02dzg4p25cx6cqsl","title":"Submission X6CQSL","payload":{"test_cases":[{"input":[0],"output":32},{"input":[100],"output":212},{"input":[37],"output":98.6},{"input":[-40],"output":-40}],"constraints":"-273 <= c <= 1000","time_limit_ms":500,"problem_statement":"Given a temperature in Celsius, convert it to Fahrenheit, rounded to 1 decimal place.","reference_solution":"def solve(c):\n return round(c * 9/5 + 32, 1)\n"}} {"submissionId":"cmsvp93ur02e0g4p2aifkzr6k","title":"Submission FKZR6K","payload":{"test_cases":[{"input":[32],"output":0},{"input":[212],"output":100},{"input":[98.6],"output":37},{"input":[-40],"output":-40}],"constraints":"-459 <= f <= 1000","time_limit_ms":500,"problem_statement":"Given a temperature in Fahrenheit, convert it to Celsius, rounded to 1 decimal place.","reference_solution":"def solve(f):\n return round((f - 32) * 5/9, 1)\n"}} {"submissionId":"cmsvp93ur02e1g4p2vihcpqn6","title":"Submission HCPQN6","payload":{"test_cases":[{"input":[1],"output":3.14},{"input":[0],"output":0},{"input":[5],"output":78.54},{"input":[2.5],"output":19.63}],"constraints":"0 <= r <= 10^4","time_limit_ms":500,"problem_statement":"Given the radius of a circle, return its area rounded to 2 decimal places (use 3.14159 for pi).","reference_solution":"def solve(r):\n return round(3.14159 * r * r, 2)\n"}} {"submissionId":"cmsvp93ur02e2g4p2wqmc27q7","title":"Submission MC27Q7","payload":{"test_cases":[{"input":[3,4],"output":12},{"input":[0,5],"output":0},{"input":[7,7],"output":49},{"input":[1,100],"output":100}],"constraints":"0 <= w, h <= 10^4","time_limit_ms":500,"problem_statement":"Given the width and height of a rectangle, return its area.","reference_solution":"def solve(w, h):\n return w * h\n"}} {"submissionId":"cmsvp93ur02e3g4p2u2z8mbt0","title":"Submission Z8MBT0","payload":{"test_cases":[{"input":[3,4],"output":14},{"input":[0,5],"output":10},{"input":[7,7],"output":28},{"input":[1,100],"output":202}],"constraints":"0 <= w, h <= 10^4","time_limit_ms":500,"problem_statement":"Given the width and height of a rectangle, return its perimeter.","reference_solution":"def solve(w, h):\n return 2 * (w + h)\n"}} {"submissionId":"cmsvp93ur02e4g4p2nb6rdzy3","title":"Submission 6RDZY3","payload":{"test_cases":[{"input":[0,0,3,4],"output":5},{"input":[0,0,0,0],"output":0},{"input":[1,1,4,5],"output":5},{"input":[-1,-1,2,3],"output":5}],"constraints":"-10^4 <= coordinate <= 10^4","time_limit_ms":500,"problem_statement":"Given two points (x1,y1) and (x2,y2), return the Euclidean distance between them, rounded to 2 decimal places.","reference_solution":"def solve(x1, y1, x2, y2):\n return round(((x2-x1)**2 + (y2-y1)**2) ** 0.5, 2)\n"}} {"submissionId":"cmsvp93ur02e5g4p2ecc1umm5","title":"Submission C1UMM5","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":true},{"input":[[3,2,1]],"output":false},{"input":[[]],"output":true},{"input":[[1]],"output":true}],"constraints":"0 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given an array of integers, determine whether it is sorted in non-decreasing order.","reference_solution":"def solve(nums):\n return all(nums[i] <= nums[i+1] for i in range(len(nums)-1))\n"}} {"submissionId":"cmsvp93ur02e6g4p2ln61ghaf","title":"Submission 61GHAF","payload":{"test_cases":[{"input":[[1,2,2,3,3,3]],"output":2},{"input":[[1,2,3]],"output":0},{"input":[[]],"output":0},{"input":[[5,5,5,5]],"output":1}],"constraints":"0 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given an array of integers, return the count of values that appear more than once (each such value counted once).","reference_solution":"def solve(nums):\n from collections import Counter\n return sum(1 for v in Counter(nums).values() if v > 1)\n"}} {"submissionId":"cmsvp93ur02e7g4p2ujvj1bcf","title":"Submission VJ1BCF","payload":{"test_cases":[{"input":[[1,[2,3],4]],"output":[1,2,3,4]},{"input":[[]],"output":[]},{"input":[[[1,2],[3,4]]],"output":[1,2,3,4]},{"input":[[1,2,3]],"output":[1,2,3]}],"constraints":"0 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given a list containing integers and possibly nested lists (only one level deep), flatten it into a single list of integers.","reference_solution":"def solve(items):\n result = []\n for x in items:\n if isinstance(x, list):\n result.extend(x)\n else:\n result.append(x)\n return result\n"}} {"submissionId":"cmsvp93ur02e8g4p2z4ekxjw9","title":"Submission EKXJW9","payload":{"test_cases":[{"input":[[5,3,8,1]],"output":3},{"input":[[1,1,2,2]],"output":2},{"input":[[10,20]],"output":20},{"input":[[-5,-1,-10,-3]],"output":-5}],"constraints":"2 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given an array of at least two distinct integers, return the second smallest value.","reference_solution":"def solve(nums):\n distinct = sorted(set(nums))\n return distinct[1]\n"}} {"submissionId":"cmsvp93ur02e9g4p2ajvx4dib","title":"Submission VX4DIB","payload":{"test_cases":[{"input":[[-1,2,-3,4]],"output":[1,2,3,4]},{"input":[[]],"output":[]},{"input":[[0,-5]],"output":[0,5]},{"input":[[1,2,3]],"output":[1,2,3]}],"constraints":"0 <= n <= 10^4, -10^6 <= value <= 10^6","time_limit_ms":500,"problem_statement":"Given an array of integers, return a new array where each element is replaced by its absolute value.","reference_solution":"def solve(nums):\n return [abs(x) for x in nums]\n"}} {"submissionId":"cmswzwbvz00czuvp23ufx3uj7","title":"Submission FX3UJ7","payload":{"test_cases":[{"input":["hello"],"output":"olleh"},{"input":[""],"output":""},{"input":["a"],"output":"a"},{"input":["racecar"],"output":"racecar"}],"constraints":"0 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, return it reversed.","reference_solution":"def solve(s):\n return s[::-1]\n"}} {"submissionId":"cmswzwbvz00d0uvp2s6zc1brk","title":"Submission ZC1BRK","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":5},{"input":[[-5,-2,-9]],"output":-2},{"input":[[7]],"output":7},{"input":[[0,0,0]],"output":0}],"constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the largest value.","reference_solution":"def solve(nums):\n return max(nums)\n"}} {"submissionId":"cmswzwbvz00d1uvp25unrpabt","title":"Submission NRPABT","payload":{"test_cases":[{"input":["Level"],"output":true},{"input":["Hello"],"output":false},{"input":["A"],"output":true},{"input":["NoonNoon"],"output":true}],"constraints":"1 <= length <= 10^4, ASCII letters only","time_limit_ms":1000,"problem_statement":"Given a string, determine whether it reads the same forwards and backwards, ignoring case.","reference_solution":"def solve(s):\n t = s.lower()\n return t == t[::-1]\n"}} {"submissionId":"cmswzwbvz00d2uvp20x3gpcwv","title":"Submission 3GPCWV","payload":{"test_cases":[{"input":["hello world"],"output":3},{"input":[""],"output":0},{"input":["AEIOU"],"output":5},{"input":["xyz"],"output":0}],"constraints":"0 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, count how many vowels (a, e, i, o, u, case-insensitive) it contains.","reference_solution":"def solve(s):\n return sum(1 for c in s.lower() if c in 'aeiou')\n"}} {"submissionId":"cmswzwbvz00d3uvp28s376dp7","title":"Submission 376DP7","payload":{"test_cases":[{"input":[0],"output":1},{"input":[1],"output":1},{"input":[5],"output":120},{"input":[10],"output":3628800}],"constraints":"0 <= n <= 20","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return n factorial.","reference_solution":"def solve(n):\n r = 1\n for i in range(2, n + 1):\n r *= i\n return r\n"}} {"submissionId":"cmswzwbvz00d4uvp2hxsef1xz","title":"Submission SEF1XZ","payload":{"test_cases":[{"input":[0],"output":0},{"input":[1],"output":1},{"input":[10],"output":55},{"input":[20],"output":6765}],"constraints":"0 <= n <= 40","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return the n-th Fibonacci number (F(0)=0, F(1)=1).","reference_solution":"def solve(n):\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n"}} {"submissionId":"cmswzwbvz00d6uvp2k091roie","title":"Submission 91ROIE","payload":{"test_cases":[{"input":[2],"output":true},{"input":[1],"output":false},{"input":[17],"output":true},{"input":[18],"output":false}],"constraints":"1 <= n <= 10^6","time_limit_ms":1000,"problem_statement":"Given a positive integer n, determine whether it is a prime number.","reference_solution":"def solve(n):\n if n < 2:\n return False\n i = 2\n while i * i <= n:\n if n % i == 0:\n return False\n i += 1\n return True\n"}} {"submissionId":"cmswzwbvz00d7uvp27n49iywb","title":"Submission 49IYWB","payload":{"test_cases":[{"input":[[1,2,2,3,1]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[5,5,5]],"output":[5]},{"input":[[1,2,3]],"output":[1,2,3]}],"constraints":"0 <= n <= 10^4, -10^5 <= value <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return a new array with duplicate values removed, preserving first-seen order.","reference_solution":"def solve(nums):\n seen = set()\n out = []\n for x in nums:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n"}} {"submissionId":"cmswzwbvz00d8uvp21aat4du7","title":"Submission AT4DU7","payload":{"test_cases":[{"input":[[[1,2],[3],[4,5]]],"output":[1,2,3,4,5]},{"input":[[]],"output":[]},{"input":[[[1],[2],[3]]],"output":[1,2,3]},{"input":[[[1,2,3]]],"output":[1,2,3]}],"constraints":"0 <= total elements <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of nested lists of integers (at most 2 levels deep), return a single flattened list.","reference_solution":"def solve(nested):\n out = []\n for item in nested:\n if isinstance(item, list):\n out.extend(item)\n else:\n out.append(item)\n return out\n"}} {"submissionId":"cmswzwbvz00d9uvp2fs43gltd","title":"Submission 43GLTD","payload":{"test_cases":[{"input":["123"],"output":6},{"input":["0"],"output":0},{"input":["9999"],"output":36},{"input":["10203"],"output":6}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string of digits, return the sum of its digits as an integer.","reference_solution":"def solve(s):\n return sum(int(c) for c in s)\n"}} {"submissionId":"cmswzwbvz00dauvp2t7b8jvgx","title":"Submission B8JVGX","payload":{"test_cases":[{"input":[2,10],"output":1024},{"input":[5,0],"output":1},{"input":[-2,3],"output":-8},{"input":[3,4],"output":81}],"constraints":"-100 <= base <= 100, 0 <= exponent <= 20","time_limit_ms":1000,"problem_statement":"Given an integer base and a non-negative integer exponent, return base raised to that power.","reference_solution":"def solve(base, exponent):\n return base ** exponent\n"}} {"submissionId":"cmswzwbvz00dbuvp2tr4ecax8","title":"Submission 4ECAX8","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["",""],"output":true},{"input":["Dormitory","dirtyroom"],"output":true}],"constraints":"0 <= length <= 10^4","time_limit_ms":1000,"problem_statement":"Given two strings, determine whether they are anagrams of each other (same letters, same multiplicity, ignoring case).","reference_solution":"def solve(a, b):\n return sorted(a.lower()) == sorted(b.lower())\n"}} {"submissionId":"cmswzwbvz00dcuvp2pdq1otcc","title":"Submission Q1OTCC","payload":{"test_cases":[{"input":[[3,0,1]],"output":2},{"input":[[0,1]],"output":2},{"input":[[9,6,4,2,3,5,7,0,1]],"output":8},{"input":[[0]],"output":1}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array containing n distinct integers from 0 to n (inclusive) with exactly one missing, return the missing number.","reference_solution":"def solve(nums):\n n = len(nums)\n total = n * (n + 1) // 2\n return total - sum(nums)\n"}} {"submissionId":"cmswzwbvz00dduvp25w4h52dw","title":"Submission 4H52DW","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],0],"output":[1,2,3]},{"input":[[1],5],"output":[1]},{"input":[[1,2,3,4],4],"output":[1,2,3,4]}],"constraints":"0 <= n <= 10^4, 0 <= k <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array and a number k, rotate the array to the right by k steps.","reference_solution":"def solve(nums, k):\n n = len(nums)\n if n == 0:\n return nums\n k %= n\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmswzwbvz00deuvp2hxxxffql","title":"Submission XXFFQL","payload":{"test_cases":[{"input":[[1,3,5],[2,4,6]],"output":[1,2,3,4,5,6]},{"input":[[],[1,2]],"output":[1,2]},{"input":[[1,2],[]],"output":[1,2]},{"input":[[1,1],[1,1]],"output":[1,1,1,1]}],"constraints":"0 <= n, m <= 10^4","time_limit_ms":1000,"problem_statement":"Given two sorted arrays of integers, merge them into one sorted array.","reference_solution":"def solve(a, b):\n out = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n out.append(a[i]); i += 1\n else:\n out.append(b[j]); j += 1\n out.extend(a[i:])\n out.extend(b[j:])\n return out\n"}} {"submissionId":"cmswzwbvz00dfuvp2ypbyjqeu","title":"Submission BYJQEU","payload":{"test_cases":[{"input":["swiss"],"output":"w"},{"input":["aabb"],"output":""},{"input":["abcabc"],"output":""},{"input":["x"],"output":"x"}],"constraints":"0 <= length <= 10^5, lowercase letters only","time_limit_ms":1000,"problem_statement":"Given a string, return the first character that does not repeat anywhere else in the string, or an empty string if none exists.","reference_solution":"def solve(s):\n from collections import Counter\n c = Counter(s)\n for ch in s:\n if c[ch] == 1:\n return ch\n return ''\n"}} {"submissionId":"cmswzwbvz00dguvp2880d83n4","title":"Submission 0D83N4","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[[1,3],[2,4]]},{"input":[[[1,2,3]]],"output":[[1],[2],[3]]},{"input":[[[1],[2],[3]]],"output":[[1,2,3]]},{"input":[[[1,2],[3,4],[5,6]]],"output":[[1,3,5],[2,4,6]]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":1000,"problem_statement":"Given a matrix represented as a list of rows, return its transpose.","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix)]\n"}} {"submissionId":"cmswzwbvz00dhuvp221vwqbeu","title":"Submission VWQBEU","payload":{"test_cases":[{"input":[[1,2,3,4],5],"output":2},{"input":[[1,1,1],2],"output":3},{"input":[[],0],"output":0},{"input":[[5],5],"output":0}],"constraints":"0 <= n <= 2000, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers and a target value, return the number of pairs (i, j) with i < j whose values sum to the target.","reference_solution":"def solve(nums, target):\n count = 0\n seen = {}\n for x in nums:\n need = target - x\n count += seen.get(need, 0)\n seen[x] = seen.get(x, 0) + 1\n return count\n"}} {"submissionId":"cmswzwbvz00diuvp2ys9hg3dj","title":"Submission 9HG3DJ","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":true},{"input":[[3,2,1]],"output":false},{"input":[[]],"output":true},{"input":[[5]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return True if it is sorted in non-decreasing order, False otherwise.","reference_solution":"def solve(nums):\n return all(nums[i] <= nums[i+1] for i in range(len(nums)-1))\n"}} {"submissionId":"cmswzwbvz00djuvp229meanq2","title":"Submission MEANQ2","payload":{"test_cases":[{"input":[1],"output":true},{"input":[16],"output":true},{"input":[18],"output":false},{"input":[0],"output":false}],"constraints":"-10^9 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given an integer n, return True if it is a power of two, False otherwise.","reference_solution":"def solve(n):\n return n > 0 and (n & (n - 1)) == 0\n"}} {"submissionId":"cmswzwbvz00dkuvp2olenqnby","title":"Submission ENQNBY","payload":{"test_cases":[{"input":["the quick brown fox"],"output":4},{"input":[""],"output":0},{"input":[" spaced out "],"output":2},{"input":["one"],"output":1}],"constraints":"0 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence, return the number of words in it (words are separated by one or more spaces).","reference_solution":"def solve(s):\n return len(s.split())\n"}} {"submissionId":"cmswzwbvz00dluvp2xyyh9lko","title":"Submission YH9LKO","payload":{"test_cases":[{"input":[[1,2,3,4,5,6]],"output":[2,4,6]},{"input":[[1,3,5]],"output":[]},{"input":[[]],"output":[]},{"input":[[-4,-3,-2]],"output":[-4,-2]}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return a new array containing only the even numbers, preserving order.","reference_solution":"def solve(nums):\n return [x for x in nums if x % 2 == 0]\n"}} {"submissionId":"cmswzwbvz00dmuvp23kyrs9e5","title":"Submission YRS9E5","payload":{"test_cases":[{"input":[3,4],"output":12},{"input":[-3,4],"output":-12},{"input":[0,5],"output":0},{"input":[-2,-6],"output":12}],"constraints":"-1000 <= a, b <= 1000","time_limit_ms":1000,"problem_statement":"Given two integers, return their product without using the multiplication operator, by repeated addition.","reference_solution":"def solve(a, b):\n neg = (a < 0) != (b < 0)\n a, b = abs(a), abs(b)\n result = 0\n for _ in range(b):\n result += a\n return -result if neg else result\n"}} {"submissionId":"cmswzwbvz00dnuvp2ks21bf27","title":"Submission 21BF27","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":4},{"input":[[7,7]],"output":null},{"input":[[1,2]],"output":1},{"input":[[10]],"output":null}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the second largest distinct value, or None if fewer than two distinct values exist.","reference_solution":"def solve(nums):\n distinct = sorted(set(nums), reverse=True)\n return distinct[1] if len(distinct) > 1 else None\n"}} {"submissionId":"cmswzwbvz00douvp213j5of4k","title":"Submission J5OF4K","payload":{"test_cases":[{"input":["abc123"],"output":true},{"input":["abcdef"],"output":false},{"input":["123456"],"output":false},{"input":[""],"output":false}],"constraints":"0 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string containing only digits and letters, return True if it contains at least one digit and at least one letter, False otherwise.","reference_solution":"def solve(s):\n has_digit = any(c.isdigit() for c in s)\n has_alpha = any(c.isalpha() for c in s)\n return has_digit and has_alpha\n"}} {"submissionId":"cmswzwbvz00dquvp2csfkhdd8","title":"Submission FKHDD8","payload":{"test_cases":[{"input":[[1,2,3,1]],"output":true},{"input":[[1,2,3]],"output":false},{"input":[[]],"output":false},{"input":[[5,5]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return True if it contains any duplicate value, False otherwise.","reference_solution":"def solve(nums):\n return len(set(nums)) != len(nums)\n"}} {"submissionId":"cmswzwbvz00druvp2c8ovdr0z","title":"Submission OVDR0Z","payload":{"test_cases":[{"input":["hello world"],"output":"Hello World"},{"input":["THE QUICK FOX"],"output":"The Quick Fox"},{"input":[""],"output":""},{"input":["a"],"output":"A"}],"constraints":"0 <= length <= 10^4","time_limit_ms":1000,"problem_statement":"Given a string, capitalize the first letter of every word and lowercase the rest, returning the result.","reference_solution":"def solve(s):\n return ' '.join(w.capitalize() for w in s.split(' '))\n"}} {"submissionId":"cmswzwbvz00dsuvp2bfqtkand","title":"Submission QTKAND","payload":{"test_cases":[{"input":[12345],"output":5},{"input":[0],"output":1},{"input":[-42],"output":2},{"input":[7],"output":1}],"constraints":"-10^9 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given an integer n, return the number of digits in its decimal representation (treat 0 as having 1 digit; ignore sign).","reference_solution":"def solve(n):\n n = abs(n)\n if n == 0:\n return 1\n count = 0\n while n > 0:\n n //= 10\n count += 1\n return count\n"}} {"submissionId":"cmswzwbvz00dtuvp20qc5sasw","title":"Submission C5SASW","payload":{"test_cases":[{"input":[[1,2,3],[3,2,1]],"output":true},{"input":[[1,2],[1,2,2]],"output":false},{"input":[[],[]],"output":true},{"input":[[1,1,2],[1,2,2]],"output":false}],"constraints":"0 <= n, m <= 10^4","time_limit_ms":1000,"problem_statement":"Given two arrays of integers, return True if they contain exactly the same multiset of elements, False otherwise.","reference_solution":"def solve(a, b):\n return sorted(a) == sorted(b)\n"}} {"submissionId":"cmswzwbvz00duuvp2en3oxn37","title":"Submission 3OXN37","payload":{"test_cases":[{"input":[[1,3,3,2]],"output":1},{"input":[[5]],"output":0},{"input":[[1,2,3,4]],"output":3},{"input":[[4,4,4]],"output":0}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the index of the first occurrence of the maximum value.","reference_solution":"def solve(nums):\n best_i = 0\n for i in range(1, len(nums)):\n if nums[i] > nums[best_i]:\n best_i = i\n return best_i\n"}} {"submissionId":"cmswzwbvz00dvuvp2b21rbzev","title":"Submission 1RBZEV","payload":{"test_cases":[{"input":[16],"output":true},{"input":[17],"output":false},{"input":[1],"output":true},{"input":[1000000000000],"output":true}],"constraints":"1 <= n <= 10^12","time_limit_ms":1000,"problem_statement":"Given a positive integer, return True if it is a perfect square, False otherwise.","reference_solution":"def solve(n):\n r = int(n ** 0.5)\n for c in (r - 1, r, r + 1):\n if c >= 0 and c * c == n:\n return True\n return False\n"}} {"submissionId":"cmswzwbvz00dwuvp2c3u64tww","title":"Submission U64TWW","payload":{"test_cases":[{"input":["the sky is blue"],"output":"blue is sky the"},{"input":["hello"],"output":"hello"},{"input":[""],"output":""},{"input":["a b c"],"output":"c b a"}],"constraints":"0 <= length <= 10^4","time_limit_ms":1000,"problem_statement":"Given a string representing a sentence, reverse the order of the words but keep each word's letters intact.","reference_solution":"def solve(s):\n return ' '.join(reversed(s.split()))\n"}} {"submissionId":"cmswzwbvz00dxuvp2tg1d842n","title":"Submission 1D842N","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]},{"input":[[-1,1,-1]],"output":[-1,0,-1]}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return a new array where each element is replaced by the running (cumulative) sum up to that index.","reference_solution":"def solve(nums):\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmswzwbvz00dyuvp2vd6xml5z","title":"Submission 6XML5Z","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":true},{"input":[[1,2,2,4]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a list of integers, return True if the list forms a strictly alternating sequence of even and odd numbers, False otherwise.","reference_solution":"def solve(nums):\n for i in range(1, len(nums)):\n if nums[i] % 2 == nums[i-1] % 2:\n return False\n return True\n"}} {"submissionId":"cmswzwbvz00dzuvp2sn1offdt","title":"Submission 1OFFDT","payload":{"test_cases":[{"input":[12],"output":[1,2,3,4,6,12]},{"input":[1],"output":[1]},{"input":[13],"output":[1,13]},{"input":[28],"output":[1,2,4,7,14,28]}],"constraints":"1 <= n <= 10^6","time_limit_ms":1000,"problem_statement":"Given an integer n, return a list of all its divisors in ascending order (including 1 and n itself).","reference_solution":"def solve(n):\n out = []\n i = 1\n while i * i <= n:\n if n % i == 0:\n out.append(i)\n if i != n // i:\n out.append(n // i)\n i += 1\n return sorted(out)\n"}} {"submissionId":"cmswzwbvz00e0uvp2l8j0vxtf","title":"Submission J0VXTF","payload":{"test_cases":[{"input":[[1,2,2,2,3]],"output":true},{"input":[[1,2,3,4]],"output":false},{"input":[[1,1]],"output":false},{"input":[[5,5,5]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return True if it contains three consecutive elements that are all equal, False otherwise.","reference_solution":"def solve(nums):\n for i in range(len(nums) - 2):\n if nums[i] == nums[i+1] == nums[i+2]:\n return True\n return False\n"}} {"submissionId":"cmswzwbvz00e1uvp23p0avrbf","title":"Submission 0AVRBF","payload":{"test_cases":[{"input":["banana"],"output":"a"},{"input":["abcabc"],"output":"a"},{"input":["z"],"output":"z"},{"input":["aabb"],"output":"a"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string of lowercase letters, return the character that occurs the most times; if there is a tie, return the one that appears first among the most frequent.","reference_solution":"def solve(s):\n from collections import Counter\n c = Counter(s)\n best = None\n best_count = -1\n for ch in s:\n if c[ch] > best_count:\n best_count = c[ch]\n best = ch\n return best\n"}} {"submissionId":"cmswzwbvz00e2uvp2rwfluznd","title":"Submission FLUZND","payload":{"test_cases":[{"input":[4,8],"output":[1,2]},{"input":[-6,3],"output":[-2,1]},{"input":[0,5],"output":[0,1]},{"input":[7,5],"output":[7,5]}],"constraints":"-10^6 <= numerator <= 10^6, 1 <= denominator <= 10^6","time_limit_ms":1000,"problem_statement":"Given two integers representing a numerator and denominator, return the fraction reduced to lowest terms as a [numerator, denominator] pair. Denominator is always positive in the result.","reference_solution":"def solve(num, den):\n import math\n g = math.gcd(abs(num), den)\n if g == 0:\n g = 1\n return [num // g, den // g]\n"}} {"submissionId":"cmswzwbvz00e3uvp2sby7hc5p","title":"Submission Y7HC5P","payload":{"test_cases":[{"input":[[1,2,3]],"output":4},{"input":[[3,4,5]],"output":1},{"input":[[]],"output":1},{"input":[[1,2,2,4]],"output":3}],"constraints":"0 <= n <= 10^5, 1 <= value <= 10^6","time_limit_ms":1000,"problem_statement":"Given an array of positive integers, return the smallest positive integer that does not appear in the array.","reference_solution":"def solve(nums):\n s = set(nums)\n i = 1\n while i in s:\n i += 1\n return i\n"}} {"submissionId":"cmswzwbvz00e4uvp2xniierxk","title":"Submission IIERXK","payload":{"test_cases":[{"input":[[1,2,3,2,1]],"output":true},{"input":[[1,2,3]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a list of integers, return True if the list is a palindrome (reads the same forwards and backwards), False otherwise.","reference_solution":"def solve(nums):\n return nums == nums[::-1]\n"}} {"submissionId":"cmswzwbvz00e5uvp2059cdou6","title":"Submission 9CDOU6","payload":{"test_cases":[{"input":["h e l l o"],"output":"hello"},{"input":[" a b "],"output":"ab"},{"input":[""],"output":""},{"input":["noSpacesHere"],"output":"noSpacesHere"}],"constraints":"0 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, remove all whitespace characters and return the result.","reference_solution":"def solve(s):\n return ''.join(s.split())\n"}} {"submissionId":"cmswzwbw000e6uvp2xiibeo03","title":"Submission IBEO03","payload":{"test_cases":[{"input":[[1,2,3,1],3],"output":true},{"input":[[1,2,3,1],2],"output":false},{"input":[[1,2,3],1],"output":false},{"input":[[1,1],1],"output":true}],"constraints":"0 <= n <= 10^5, 0 <= k <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers and an integer k, return True if there exist two distinct indices i and j such that nums[i] == nums[j] and the absolute difference between i and j is at most k.","reference_solution":"def solve(nums, k):\n last_seen = {}\n for i, x in enumerate(nums):\n if x in last_seen and i - last_seen[x] <= k:\n return True\n last_seen[x] = i\n return False\n"}} {"submissionId":"cmswzwbw000e7uvp2lyp958y5","title":"Submission P958Y5","payload":{"test_cases":[{"input":[10],"output":23},{"input":[1],"output":0},{"input":[16],"output":60},{"input":[0],"output":0}],"constraints":"0 <= n <= 10^6","time_limit_ms":1000,"problem_statement":"Given an integer n, return the sum of all multiples of 3 or 5 below n.","reference_solution":"def solve(n):\n return sum(i for i in range(n) if i % 3 == 0 or i % 5 == 0)\n"}} {"submissionId":"cmswzwbw000e8uvp2zj1ryl7i","title":"Submission 1RYL7I","payload":{"test_cases":[{"input":[[3,8,15,17]],"output":[2,3]},{"input":[[1,5,9,2]],"output":[0,3]},{"input":[[10,20]],"output":[0,1]},{"input":[[4,1,7,2]],"output":[1,3]}],"constraints":"2 <= n <= 2000, -10^5 <= value <= 10^5","time_limit_ms":1000,"problem_statement":"Given a list of integers, return the two indices (as a sorted pair [i, j] with i < j) of the elements with the smallest absolute difference. Assume the list has at least two elements and a unique answer.","reference_solution":"def solve(nums):\n indexed = sorted(range(len(nums)), key=lambda i: nums[i])\n best_diff = None\n best_pair = None\n for k in range(len(indexed) - 1):\n i, j = indexed[k], indexed[k+1]\n diff = abs(nums[i] - nums[j])\n if best_diff is None or diff < best_diff:\n best_diff = diff\n best_pair = tuple(sorted((i, j)))\n return list(best_pair)\n"}} {"submissionId":"cmswzwbw000e9uvp2gzwqf5cu","title":"Submission WQF5CU","payload":{"test_cases":[{"input":["101"],"output":5},{"input":["0"],"output":0},{"input":["1111"],"output":15},{"input":["100000"],"output":32}],"constraints":"1 <= length <= 32, characters are '0' or '1'","time_limit_ms":1000,"problem_statement":"Given a string representing a binary number, return its decimal integer value.","reference_solution":"def solve(s):\n return int(s, 2)\n"}} {"submissionId":"cmswzwbw000eauvp23r8283oq","title":"Submission 8283OQ","payload":{"test_cases":[{"input":[5],"output":"101"},{"input":[0],"output":"0"},{"input":[8],"output":"1000"},{"input":[255],"output":"11111111"}],"constraints":"0 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given a non-negative integer, return its representation as a binary string with no leading zeros (use '0' for the value zero).","reference_solution":"def solve(n):\n return bin(n)[2:]\n"}} {"submissionId":"cmswzwbw000ebuvp2xp3xqn80","title":"Submission 3XQN80","payload":{"test_cases":[{"input":[[1,1,2,3,3,3]],"output":2},{"input":[[]],"output":0},{"input":[[4,4]],"output":0},{"input":[[5]],"output":1}],"constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the number of distinct values that appear an odd number of times.","reference_solution":"def solve(nums):\n from collections import Counter\n c = Counter(nums)\n return sum(1 for v in c.values() if v % 2 == 1)\n"}} {"submissionId":"cmswzzexb00ehuvp2l85ct0rn","title":"Submission 5CT0RN","payload":{"test_cases":[{"input":[[1,-2,3,-4]],"output":2},{"input":[[]],"output":0},{"input":[[-1,-2,-3]],"output":3},{"input":[[5,6,7]],"output":0}],"constraints":"0 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the count of negative numbers in it.","reference_solution":"def solve(nums):\n count = 0\n for x in nums:\n if x < 0:\n count += 1\n return count\n"}} {"submissionId":"cmsx6cckn00g0x3p2oav9kqht","title":"Submission V9KQHT","payload":{"test_cases":[{"input":["Hello World"],"output":3},{"input":["AEIOU"],"output":5},{"input":["rhythm"],"output":0}],"constraints":"0 <= length <= 10^5; ASCII letters and symbols","time_limit_ms":500,"problem_statement":"Given a string, return the number of vowels, treating uppercase and lowercase equally.","reference_solution":"def solve(s):\n return sum(c.lower() in 'aeiou' for c in s)\n"}} {"submissionId":"cmsx6cckn00g1x3p2ow4qpey0","title":"Submission 4QPEY0","payload":{"test_cases":[{"input":[48,18],"output":6},{"input":[7,13],"output":1},{"input":[0,9],"output":9}],"constraints":"0 <= a,b <= 10^9; not both zero","time_limit_ms":500,"problem_statement":"Given integers a and b, return their greatest common divisor.","reference_solution":"def solve(a,b):\n while b:\n a,b=b,a%b\n return a\n"}} {"submissionId":"cmsx6cckn00g2x3p29y22bj8t","title":"Submission 22BJ8T","payload":{"test_cases":[{"input":[[3,10,6,2]],"output":8},{"input":[[5]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the maximum difference between any value and the minimum value. Return 0 for an empty list.","reference_solution":"def solve(nums):\n return 0 if not nums else max(nums)-min(nums)\n"}} {"submissionId":"cmsx6cckn00g3x3p2e8dov165","title":"Submission DOV165","payload":{"test_cases":[{"input":["aaabbcca"],"output":"abca"},{"input":["abc"],"output":"abc"},{"input":[""],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return it with consecutive duplicate characters collapsed to one character.","reference_solution":"def solve(s):\n out=[]\n for c in s:\n if not out or out[-1]!=c:\n out.append(c)\n return ''.join(out)\n"}} {"submissionId":"cmsx6cckn00g4x3p2d44x5tbd","title":"Submission 4X5TBD","payload":{"test_cases":[{"input":[[1,5,7,2],4],"output":2},{"input":[[3,3,3],3],"output":0},{"input":[[],0],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers and target, return how many values are strictly greater than target.","reference_solution":"def solve(nums,target):\n return sum(x>target for x in nums)\n"}} {"submissionId":"cmsx6cckn00g5x3p25wl21a5x","title":"Submission L21A5X","payload":{"test_cases":[{"input":[12345],"output":15},{"input":[0],"output":0},{"input":[90001],"output":10}],"constraints":"0 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a nonnegative integer n, return the sum of its decimal digits.","reference_solution":"def solve(n):\n return sum(map(int,str(n)))\n"}} {"submissionId":"cmsx6cckn00g6x3p2xehdaiam","title":"Submission HDAIAM","payload":{"test_cases":[{"input":[["cat","house","tree"]],"output":"house"},{"input":[["aa","bb","c"]],"output":"aa"},{"input":[[]],"output":""}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of words, return the longest word. On ties, return the earliest one. Return empty string for empty input.","reference_solution":"def solve(words):\n return '' if not words else max(enumerate(words),key=lambda p:(len(p[1]),-p[0]))[1]\n"}} {"submissionId":"cmsx6cckn00g7x3p2qeedx08a","title":"Submission EDX08A","payload":{"test_cases":[{"input":[16],"output":true},{"input":[15],"output":false},{"input":[0],"output":true}],"constraints":"0 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given an integer n, return True if it is a perfect square, otherwise False.","reference_solution":"def solve(n):\n import math\n r=math.isqrt(n)\n return r*r==n\n"}} {"submissionId":"cmsx6cckn00g8x3p2smok5gsh","title":"Submission OK5GSH","payload":{"test_cases":[{"input":[[1,2,1,3,2]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[5,5,5]],"output":[5]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return a new list containing only the first occurrence of each value, preserving order.","reference_solution":"def solve(nums):\n seen=set();out=[]\n for x in nums:\n if x not in seen:\n seen.add(x);out.append(x)\n return out\n"}} {"submissionId":"cmsx6cckn00g9x3p23lj6vt0i","title":"Submission J6VT0I","payload":{"test_cases":[{"input":["Listen","Silent"],"output":true},{"input":["abc","abd"],"output":false},{"input":["",""],"output":true}],"constraints":"0 <= length <= 10^5; letters only","time_limit_ms":500,"problem_statement":"Given two strings, return True if they are anagrams when case is ignored.","reference_solution":"def solve(a,b):\n return sorted(a.lower())==sorted(b.lower())\n"}} {"submissionId":"cmsx6cckn00gax3p2z88kewc7","title":"Submission 8KEWC7","payload":{"test_cases":[{"input":[[5,1,5,3]],"output":3},{"input":[[2,2]],"output":null},{"input":[[]],"output":null}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the second largest distinct value, or None if fewer than two distinct values exist.","reference_solution":"def solve(nums):\n a=sorted(set(nums),reverse=True)\n return a[1] if len(a)>=2 else None\n"}} {"submissionId":"cmsx6cckn00gbx3p2msalisz8","title":"Submission ALISZ8","payload":{"test_cases":[{"input":["one two three"],"output":"three two one"},{"input":[" a b "],"output":"b a"},{"input":[""],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string of words separated by spaces, return the words in reverse order with single spaces between them.","reference_solution":"def solve(s):\n return ' '.join(reversed(s.split()))\n"}} {"submissionId":"cmsx6cckn00gcx3p2rgx7rmg9","title":"Submission X7RMG9","payload":{"test_cases":[{"input":[6,8],"output":24},{"input":[7,5],"output":35},{"input":[9,3],"output":9}],"constraints":"1 <= a,b <= 10^9","time_limit_ms":500,"problem_statement":"Given positive integers a and b, return their least common multiple.","reference_solution":"def solve(a,b):\n import math\n return a//math.gcd(a,b)*b\n"}} {"submissionId":"cmsx6cckn00gdx3p2m0rupoa9","title":"Submission RUPOA9","payload":{"test_cases":[{"input":[[-1,0,2,-3]],"output":2},{"input":[[1,2]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the count of negative values.","reference_solution":"def solve(nums):\n return sum(x<0 for x in nums)\n"}} {"submissionId":"cmsx6cckn00gex3p2vvivp1dc","title":"Submission IVP1DC","payload":{"test_cases":[{"input":["Never odd or even"],"output":true},{"input":["hello"],"output":false},{"input":[""],"output":true}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if it reads the same forward and backward after removing spaces and ignoring case.","reference_solution":"def solve(s):\n t=''.join(c.lower() for c in s if c!=' ')\n return t==t[::-1]\n"}} {"submissionId":"cmsx6cckn00gfx3p2sgmqvdwg","title":"Submission MQVDWG","payload":{"test_cases":[{"input":[[2,3,4]],"output":24},{"input":[[-2,5]],"output":-10},{"input":[[]],"output":1}],"constraints":"0 <= n <= 10^4; product fits Python integer","time_limit_ms":500,"problem_statement":"Given a list of integers, return the product of all values. Return 1 for an empty list.","reference_solution":"def solve(nums):\n p=1\n for x in nums:p*=x\n return p\n"}} {"submissionId":"cmsx6cckn00ggx3p2lde0bvap","title":"Submission E0BVAP","payload":{"test_cases":[{"input":[12],"output":[1,2,3,4,6,12]},{"input":[7],"output":[1,7]},{"input":[1],"output":[1]}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given an integer n, return a list of all divisors of n in increasing order.","reference_solution":"def solve(n):\n out=[]\n i=1\n while i*i<=n:\n if n%i==0:\n out.append(i)\n if i*i!=n: out.append(n//i)\n i+=1\n return sorted(out)\n"}} {"submissionId":"cmsx6cckn00ghx3p2mwmutr46","title":"Submission MUTR46","payload":{"test_cases":[{"input":[[1,2,2,5]],"output":true},{"input":[[3,2,1]],"output":false},{"input":[[]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return True if it is nondecreasing.","reference_solution":"def solve(nums):\n return all(nums[i]<=nums[i+1] for i in range(len(nums)-1))\n"}} {"submissionId":"cmsx6cckn00gix3p2ut518nrq","title":"Submission 518NRQ","payload":{"test_cases":[{"input":["aba"],"output":{"a":2,"b":1}},{"input":[""],"output":{}},{"input":["!!a"],"output":{"!":2,"a":1}}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return a dictionary mapping each character to its frequency.","reference_solution":"def solve(s):\n d={}\n for c in s:d[c]=d.get(c,0)+1\n return d\n"}} {"submissionId":"cmsx6cckn00gjx3p2at8kcmaf","title":"Submission 8KCMAF","payload":{"test_cases":[{"input":[1,8,2],"output":[1,3,5,7]},{"input":[5,5,1],"output":[]},{"input":[-2,3,2],"output":[-2,0,2]}],"constraints":"-10^6 <= start,end <= 10^6; 1 <= step <= 10^6","time_limit_ms":500,"problem_statement":"Given integers start, end, and step where step is positive, return the arithmetic sequence from start up to but not including end.","reference_solution":"def solve(start,end,step):\n return list(range(start,end,step))\n"}} {"submissionId":"cmsx6cckn00gkx3p2y2rjwp5h","title":"Submission RJWP5H","payload":{"test_cases":[{"input":[[2,4,6]],"output":4},{"input":[[1,2]],"output":1.5},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of numbers, return the average as a float. Return 0.0 for an empty list.","reference_solution":"def solve(nums):\n return 0.0 if not nums else sum(nums)/len(nums)\n"}} {"submissionId":"cmsx6cckn00glx3p2pbu85bv5","title":"Submission U85BV5","payload":{"test_cases":[{"input":["banana","a"],"output":[1,3,5]},{"input":["abc","x"],"output":[]},{"input":["","a"],"output":[]}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string and a character, return the list of indices where the character occurs.","reference_solution":"def solve(s,ch):\n return [i for i,c in enumerate(s) if c==ch]\n"}} {"submissionId":"cmsx6cckn00gmx3p2ubqox62t","title":"Submission QOX62T","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":9},{"input":[[10]],"output":10},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of values at even indices.","reference_solution":"def solve(nums):\n return sum(nums[::2])\n"}} {"submissionId":"cmsx6cckn00gnx3p2z0asop9u","title":"Submission ASOP9U","payload":{"test_cases":[{"input":[[1,2,3,4],1],"output":[4,1,2,3]},{"input":[[1,2,3],4],"output":[3,1,2]},{"input":[[],5],"output":[]}],"constraints":"0 <= n <= 10^5; 0 <= k <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers, rotate it right by k positions. Return empty list for empty input.","reference_solution":"def solve(nums,k):\n if not nums:return []\n k%=len(nums)\n return nums[-k:]+nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsx6cckn00gox3p2qzkbwo3f","title":"Submission KBWO3F","payload":{"test_cases":[{"input":[10],"output":"1010"},{"input":[0],"output":"0"},{"input":[1],"output":"1"}],"constraints":"0 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a nonnegative integer n, return its binary representation without the 0b prefix.","reference_solution":"def solve(n):\n return bin(n)[2:]\n"}} {"submissionId":"cmsx6cckn00gpx3p2fpgxxutu","title":"Submission GXXUTU","payload":{"test_cases":[{"input":[[1,1,2,2,2]],"output":3},{"input":[[1,2,3]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the number of adjacent pairs with equal values.","reference_solution":"def solve(nums):\n return sum(nums[i]==nums[i-1] for i in range(1,len(nums)))\n"}} {"submissionId":"cmsx6cckn00gqx3p2a2zv7w59","title":"Submission ZV7W59","payload":{"test_cases":[{"input":["swiss"],"output":"w"},{"input":["aabb"],"output":""},{"input":["x"],"output":"x"}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the first non-repeating character, or empty string if none exists.","reference_solution":"def solve(s):\n from collections import Counter\n c=Counter(s)\n for ch in s:\n if c[ch]==1:return ch\n return ''\n"}} {"submissionId":"cmsx6cckn00grx3p2cj9khdm6","title":"Submission 9KHDM6","payload":{"test_cases":[{"input":[[-3,0,4]],"output":[3,0,4]},{"input":[[]],"output":[]},{"input":[[-1,-2]],"output":[1,2]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return a list of their absolute values.","reference_solution":"def solve(nums):\n return [abs(x) for x in nums]\n"}} {"submissionId":"cmsx6cckn00gtx3p2umbhcg4x","title":"Submission BHCG4X","payload":{"test_cases":[{"input":[[3,1,3,2]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[5,5]],"output":[5]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return a sorted list of the distinct values.","reference_solution":"def solve(nums):\n return sorted(set(nums))\n"}} {"submissionId":"cmsx6cckn00gux3p2wnmmms4j","title":"Submission MMMS4J","payload":{"test_cases":[{"input":[2],"output":true},{"input":[17],"output":true},{"input":[21],"output":false}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer n, return True if n is prime.","reference_solution":"def solve(n):\n if n<2:return False\n i=2\n while i*i<=n:\n if n%i==0:return False\n i+=1\n return True\n"}} {"submissionId":"cmsx6cckn00gvx3p2jy76spli","title":"Submission 76SPLI","payload":{"test_cases":[{"input":[["pear","a","fig","apple"]],"output":["a","fig","pear","apple"]},{"input":[[]],"output":[]},{"input":[["bb","aa"]],"output":["aa","bb"]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of strings, return them sorted by length ascending, then alphabetically.","reference_solution":"def solve(words):\n return sorted(words,key=lambda w:(len(w),w))\n"}} {"submissionId":"cmsx6cckn00gwx3p2j31ao1ge","title":"Submission 1AO1GE","payload":{"test_cases":[{"input":[5],"output":15},{"input":[0],"output":0},{"input":[1],"output":1}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given an integer n, return the sum of integers from 1 through n inclusive.","reference_solution":"def solve(n):\n return n*(n+1)//2\n"}} {"submissionId":"cmsx6cckn00gxx3p2wfrcga2o","title":"Submission RCGA2O","payload":{"test_cases":[{"input":[[1,5,3,5]],"output":1},{"input":[[-2,-1]],"output":1},{"input":[[]],"output":-1}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the index of the first occurrence of its maximum value, or -1 for empty input.","reference_solution":"def solve(nums):\n return -1 if not nums else nums.index(max(nums))\n"}} {"submissionId":"cmsx6cckn00gyx3p2oprpi785","title":"Submission RPI785","payload":{"test_cases":[{"input":["a1b23"],"output":"a#b##"},{"input":["abc"],"output":"abc"},{"input":["123"],"output":"###"}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, replace every digit with '#'.","reference_solution":"def solve(s):\n return ''.join('#' if c.isdigit() else c for c in s)\n"}} {"submissionId":"cmsx6ccko00gzx3p2f8nelnho","title":"Submission NELNHO","payload":{"test_cases":[{"input":[[1,2,2,3],[2,3,4]],"output":[2,3]},{"input":[[],[1]],"output":[]},{"input":[[5],[5,5]],"output":[5]}],"constraints":"0 <= lengths <= 10^5","time_limit_ms":500,"problem_statement":"Given two lists, return their intersection as sorted distinct values.","reference_solution":"def solve(a,b):\n return sorted(set(a)&set(b))\n"}} {"submissionId":"cmsx6ccko00h0x3p2k9u55syw","title":"Submission U55SYW","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[-1,4]],"output":[-1,3]},{"input":[[]],"output":[]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the prefix sums.","reference_solution":"def solve(nums):\n out=[];s=0\n for x in nums:s+=x;out.append(s)\n return out\n"}} {"submissionId":"cmsx6ccko00h1x3p2t1igp8jr","title":"Submission IGP8JR","payload":{"test_cases":[{"input":["abacb"],"output":"a"},{"input":["zzxyy"],"output":"z"},{"input":[""],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the character with highest frequency. Break ties by earliest first occurrence. Return empty string for empty input.","reference_solution":"def solve(s):\n if not s:return ''\n d={}\n for c in s:d[c]=d.get(c,0)+1\n best=s[0]\n for c in s:\n if d[c]>d[best]:best=c\n return best\n"}} {"submissionId":"cmsx6ccko00h2x3p2wlz8ypvw","title":"Submission Z8YPVW","payload":{"test_cases":[{"input":[2,10],"output":1024},{"input":[5,0],"output":1},{"input":[-2,3],"output":-8}],"constraints":"-10^4 <= n <= 10^4; 0 <= k <= 20","time_limit_ms":500,"problem_statement":"Given integers n and k, return n raised to the k-th power.","reference_solution":"def solve(n,k):\n return n**k\n"}} {"submissionId":"cmsx6ccko00h3x3p2cfmqiosf","title":"Submission MQIOSF","payload":{"test_cases":[{"input":[[1,2,1,3]],"output":3},{"input":[[]],"output":0},{"input":[[4,4]],"output":1}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return how many distinct values it contains.","reference_solution":"def solve(nums):\n return len(set(nums))\n"}} {"submissionId":"cmsx6ccko00h4x3p2efwbtvgt","title":"Submission WBTVGT","payload":{"test_cases":[{"input":["AbC1"],"output":"aBc1"},{"input":["hello"],"output":"HELLO"},{"input":[""],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return it with all alphabetic characters swapped between uppercase and lowercase.","reference_solution":"def solve(s):\n return s.swapcase()\n"}} {"submissionId":"cmsx6ccko00h5x3p29v6dy92x","title":"Submission 6DY92X","payload":{"test_cases":[{"input":[[3,1,8,4]],"output":9},{"input":[[5]],"output":10},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of its smallest and largest value. Return 0 for empty input.","reference_solution":"def solve(nums):\n return 0 if not nums else min(nums)+max(nums)\n"}} {"submissionId":"cmsx6ccko00h6x3p20vahikaf","title":"Submission AHIKAF","payload":{"test_cases":[{"input":["AbC!d"],"output":2},{"input":["abc"],"output":0},{"input":["XYZ"],"output":3}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the number of uppercase alphabetic characters.","reference_solution":"def solve(s):\n return sum(c.isupper() for c in s)\n"}} {"submissionId":"cmsx6ccko00h7x3p2lyinfotc","title":"Submission INFOTC","payload":{"test_cases":[{"input":[[0,1,0,3,2]],"output":[1,3,2,0,0]},{"input":[[1,2]],"output":[1,2]},{"input":[[0,0]],"output":[0,0]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, move all zeros to the end while preserving the order of nonzero values.","reference_solution":"def solve(nums):\n a=[x for x in nums if x!=0]\n return a+[0]*(len(nums)-len(a))\n"}} {"submissionId":"cmsx6ccko00h8x3p2llsz7qsg","title":"Submission SZ7QSG","payload":{"test_cases":[{"input":["abc123"],"output":true},{"input":["abC"],"output":false},{"input":["123"],"output":true}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if every alphabetic character is lowercase.","reference_solution":"def solve(s):\n return all(not c.isalpha() or c.islower() for c in s)\n"}} {"submissionId":"cmsx6ccko00h9x3p2tybvg6zw","title":"Submission BVG6ZW","payload":{"test_cases":[{"input":[[1,-2,3]],"output":[1,4,9]},{"input":[[]],"output":[]},{"input":[[0]],"output":[0]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the list with each value squared.","reference_solution":"def solve(nums):\n return [x*x for x in nums]\n"}} {"submissionId":"cmsx6ccko00hax3p28mr3v0k0","title":"Submission R3V0K0","payload":{"test_cases":[{"input":[12],"output":6},{"input":[16],"output":5},{"input":[7],"output":2}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer n, return the count of its divisors.","reference_solution":"def solve(n):\n c=0;i=1\n while i*i<=n:\n if n%i==0:c+=1 if i*i==n else 2\n i+=1\n return c\n"}} {"submissionId":"cmsx6ccko00hbx3p2fn0sqz5w","title":"Submission 0SQZ5W","payload":{"test_cases":[{"input":[[3,1,2]],"output":2},{"input":[[1,4,2,3]],"output":2.5},{"input":[[]],"output":null}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the median. For even length return the average of the two middle values. Return None for empty input.","reference_solution":"def solve(nums):\n if not nums:return None\n a=sorted(nums);n=len(a);m=n//2\n return a[m] if n%2 else (a[m-1]+a[m])/2\n"}} {"submissionId":"cmsx6ccko00hcx3p2plkkp5of","title":"Submission KKP5OF","payload":{"test_cases":[{"input":["aaabbcaaaa"],"output":4},{"input":["abc"],"output":1},{"input":[""],"output":0}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the length of the longest run of the same consecutive character. Return 0 for empty input.","reference_solution":"def solve(s):\n if not s:return 0\n best=cur=1\n for i in range(1,len(s)):\n cur=cur+1 if s[i]==s[i-1] else 1\n best=max(best,cur)\n return best\n"}} {"submissionId":"cmsx6cr6600hdx3p2fz4p9quv","title":"Submission 4P9QUV","payload":{"test_cases":[{"input":[[1,2,2,3,4,4]],"output":4},{"input":[[5,5]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5; values between -10^6 and 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of values that appear exactly once in the list.","reference_solution":"def solve(nums):\n from collections import Counter\n c=Counter(nums)\n return sum(x for x in nums if c[x]==1)\n"}} {"submissionId":"cmsx7admb0000kup2kazjnimg","title":"Submission ZJNIMG","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":4},{"input":[[-3,-2,-1]],"output":-4},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5; values between -10^6 and 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of all odd values.","reference_solution":"def solve(nums):\n return sum(x for x in nums if x % 2 != 0)\n"}} {"submissionId":"cmsx7admb0001kup2lplgm58l","title":"Submission LGM58L","payload":{"test_cases":[{"input":["Hello!"],"output":3},{"input":["AEIOU"],"output":0},{"input":["bcd"],"output":3}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the number of consonant letters, ignoring case and non-letters.","reference_solution":"def solve(s):\n return sum(c.isalpha() and c.lower() not in 'aeiou' for c in s)\n"}} {"submissionId":"cmsx7admb0002kup270nnox89","title":"Submission NNOX89","payload":{"test_cases":[{"input":[5,2],"output":3},{"input":[-3,4],"output":7},{"input":[7,7],"output":0}],"constraints":"-10^9 <= a,b <= 10^9","time_limit_ms":500,"problem_statement":"Given two integers a and b, return their absolute difference.","reference_solution":"def solve(a,b):\n return abs(a-b)\n"}} {"submissionId":"cmsx7admb0003kup24fr7x59c","title":"Submission R7X59C","payload":{"test_cases":[{"input":[[3,1,5]],"output":1},{"input":[[-2,-7,0]],"output":-7},{"input":[[]],"output":null}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the smallest value, or None if the list is empty.","reference_solution":"def solve(nums):\n return min(nums) if nums else None\n"}} {"submissionId":"cmsx7admb0004kup2jthyarlk","title":"Submission HYARLK","payload":{"test_cases":[{"input":["abc"],"output":"cba"},{"input":[""],"output":""},{"input":["a"],"output":"a"}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return it with characters in reverse order.","reference_solution":"def solve(s):\n return s[::-1]\n"}} {"submissionId":"cmsx7admc0005kup2651fla18","title":"Submission 1FLA18","payload":{"test_cases":[{"input":[15],"output":true},{"input":[9],"output":false},{"input":[30],"output":true}],"constraints":"1 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a positive integer n, return True if n is divisible by both 3 and 5.","reference_solution":"def solve(n):\n return n % 15 == 0\n"}} {"submissionId":"cmsx7admc0006kup2tce73n54","title":"Submission E73N54","payload":{"test_cases":[{"input":[[0,1,0,2]],"output":2},{"input":[[1,2]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the number of zero values.","reference_solution":"def solve(nums):\n return nums.count(0)\n"}} {"submissionId":"cmsx7admc0007kup2dehdiezy","title":"Submission HDIEZY","payload":{"test_cases":[{"input":["a1b23"],"output":3},{"input":["abc"],"output":0},{"input":["007"],"output":3}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the number of digit characters it contains.","reference_solution":"def solve(s):\n return sum(c.isdigit() for c in s)\n"}} {"submissionId":"cmsx7admc0008kup2mrqa1ixq","title":"Submission QA1IXQ","payload":{"test_cases":[{"input":[[1,2,3],2],"output":true},{"input":[[1,2,3],4],"output":false},{"input":[[],0],"output":false}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers and a target, return True if target appears in the list.","reference_solution":"def solve(nums,target):\n return target in nums\n"}} {"submissionId":"cmsx7admc0009kup23o2vzf7t","title":"Submission 2VZF7T","payload":{"test_cases":[{"input":["hello","world"],"output":"hello world"},{"input":["","x"],"output":" x"},{"input":["a",""],"output":"a "}],"constraints":"0 <= lengths <= 10^5","time_limit_ms":500,"problem_statement":"Given two strings, return their concatenation with a single space between them.","reference_solution":"def solve(a,b):\n return a + ' ' + b\n"}} {"submissionId":"cmsx7admc000akup2kcjv9vjm","title":"Submission JV9VJM","payload":{"test_cases":[{"input":[123],"output":3},{"input":[-987],"output":7},{"input":[0],"output":0}],"constraints":"-10^18 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given an integer n, return the last decimal digit of its absolute value.","reference_solution":"def solve(n):\n return abs(n) % 10\n"}} {"submissionId":"cmsx7admc000bkup2jd72ccu5","title":"Submission 72CCU5","payload":{"test_cases":[{"input":[[-1,0,2,3]],"output":[2,3]},{"input":[[-2,-1]],"output":[]},{"input":[[]],"output":[]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return a list containing only positive values in original order.","reference_solution":"def solve(nums):\n return [x for x in nums if x > 0]\n"}} {"submissionId":"cmsx7admc000ckup25z5thi1y","title":"Submission 5THI1Y","payload":{"test_cases":[{"input":["Abc"],"output":"ABC"},{"input":["123"],"output":"123"},{"input":[""],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return it converted to uppercase.","reference_solution":"def solve(s):\n return s.upper()\n"}} {"submissionId":"cmsx7admc000dkup2vwl5hwu2","title":"Submission L5HWU2","payload":{"test_cases":[{"input":[[1,2,3]],"output":4},{"input":[[5]],"output":10},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of its first and last values. Return 0 if empty and the sole value doubled if length is 1.","reference_solution":"def solve(nums):\n if not nums: return 0\n return nums[0] + nums[-1]\n"}} {"submissionId":"cmsx7admc000ekup23agc6h49","title":"Submission GC6H49","payload":{"test_cases":[{"input":[4],"output":true},{"input":[5],"output":false},{"input":[-2],"output":true}],"constraints":"-10^18 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given an integer n, return True if it is even.","reference_solution":"def solve(n):\n return n % 2 == 0\n"}} {"submissionId":"cmsx7admc000fkup2hl8tmwe5","title":"Submission 8TMWE5","payload":{"test_cases":[{"input":[["a","bc","def"]],"output":6},{"input":[[]],"output":0},{"input":[[""]],"output":0}],"constraints":"0 <= n <= 10^5; total length <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of strings, return their total number of characters.","reference_solution":"def solve(words):\n return sum(len(w) for w in words)\n"}} {"submissionId":"cmsx7admc000gkup27v5zmhzz","title":"Submission 5ZMHZZ","payload":{"test_cases":[{"input":["a b"],"output":1},{"input":["abc"],"output":-1},{"input":[" hello"],"output":0}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the index of its first space, or -1 if there is no space.","reference_solution":"def solve(s):\n return s.find(' ')\n"}} {"submissionId":"cmsx7admc000hkup29q639jjn","title":"Submission 639JJN","payload":{"test_cases":[{"input":[[3,1,2]],"output":[3,2,1]},{"input":[[]],"output":[]},{"input":[[5,5,1]],"output":[5,5,1]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return a new list sorted in descending order.","reference_solution":"def solve(nums):\n return sorted(nums, reverse=True)\n"}} {"submissionId":"cmsx7admc000ikup2ruo6qbf5","title":"Submission O6QBF5","payload":{"test_cases":[{"input":[0],"output":1},{"input":[12345],"output":5},{"input":[9],"output":1}],"constraints":"0 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given a nonnegative integer n, return the number of decimal digits in n.","reference_solution":"def solve(n):\n return len(str(n))\n"}} {"submissionId":"cmsx7admc000jkup20p8q6ogh","title":"Submission 8Q6OGH","payload":{"test_cases":[{"input":["aba"],"output":true},{"input":["abc"],"output":false},{"input":[""],"output":false}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if it starts and ends with the same character. Return False for empty input.","reference_solution":"def solve(s):\n return bool(s) and s[0] == s[-1]\n"}} {"submissionId":"cmsx7admc000kkup2kke46ttd","title":"Submission E46TTD","payload":{"test_cases":[{"input":[[1,3,3,2]],"output":2},{"input":[[5]],"output":1},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the count of values equal to the maximum value. Return 0 for empty input.","reference_solution":"def solve(nums):\n if not nums: return 0\n m=max(nums)\n return nums.count(m)\n"}} {"submissionId":"cmsx7admc000lkup29dut2c9i","title":"Submission UT2C9I","payload":{"test_cases":[{"input":["a b c"],"output":"abc"},{"input":["abc"],"output":"abc"},{"input":[" "],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, remove all space characters and return the result.","reference_solution":"def solve(s):\n return s.replace(' ','')\n"}} {"submissionId":"cmsx7admc000mkup2fhwot9yw","title":"Submission WOT9YW","payload":{"test_cases":[{"input":[3,5],"output":5},{"input":[7,7],"output":7},{"input":[-2,-5],"output":-2}],"constraints":"-10^9 <= a,b <= 10^9","time_limit_ms":500,"problem_statement":"Given integers a and b, return the larger value. If equal, return either value.","reference_solution":"def solve(a,b):\n return max(a,b)\n"}} {"submissionId":"cmsx7admc000nkup2i0z3xpwg","title":"Submission Z3XPWG","payload":{"test_cases":[{"input":[[0,1,2]],"output":true},{"input":[[1,-1]],"output":false},{"input":[[]],"output":true}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return True if all values are nonnegative.","reference_solution":"def solve(nums):\n return all(x >= 0 for x in nums)\n"}} {"submissionId":"cmsx7admc000okup2nmzybm2v","title":"Submission ZYBM2V","payload":{"test_cases":[{"input":["abc"],"output":"b"},{"input":["abcd"],"output":"bc"},{"input":["x"],"output":"x"}],"constraints":"1 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return its middle character if its length is odd, otherwise return the two middle characters.","reference_solution":"def solve(s):\n n=len(s);m=n//2\n return s[m] if n%2 else s[m-1:m+1]\n"}} {"submissionId":"cmsx7admc000pkup2ynymwhco","title":"Submission YMWHCO","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":5},{"input":[[1,1,2]],"output":0},{"input":[[5]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of values strictly between the minimum and maximum. Return 0 if fewer than 3 values.","reference_solution":"def solve(nums):\n if len(nums)<3:return 0\n lo=min(nums);hi=max(nums)\n return sum(x for x in nums if lo < x < hi)\n"}} {"submissionId":"cmsx7admc000qkup2ai0bd5be","title":"Submission 0BD5BE","payload":{"test_cases":[{"input":["AbcD"],"output":2},{"input":["ABC"],"output":0},{"input":["a1b"],"output":2}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the number of lowercase alphabetic characters.","reference_solution":"def solve(s):\n return sum(c.islower() for c in s)\n"}} {"submissionId":"cmsx7admc000rkup23bvejwqt","title":"Submission VEJWQT","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":[2,4]},{"input":[[7]],"output":[]},{"input":[[]],"output":[]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return a list of values at odd indices.","reference_solution":"def solve(nums):\n return nums[1::2]\n"}} {"submissionId":"cmsx7admc000skup22n7eb8wo","title":"Submission 7EB8WO","payload":{"test_cases":[{"input":[5],"output":120},{"input":[0],"output":1},{"input":[1],"output":1}],"constraints":"0 <= n <= 20","time_limit_ms":500,"problem_statement":"Given a positive integer n, return n factorial.","reference_solution":"def solve(n):\n p=1\n for i in range(2,n+1):p*=i\n return p\n"}} {"submissionId":"cmsx7admc000tkup2a768kb1r","title":"Submission 68KB1R","payload":{"test_cases":[{"input":["abc1"],"output":true},{"input":["abc"],"output":false},{"input":[""],"output":false}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if it contains at least one digit.","reference_solution":"def solve(s):\n return any(c.isdigit() for c in s)\n"}} {"submissionId":"cmsx7admc000ukup2e1k9ipq0","title":"Submission K9IPQ0","payload":{"test_cases":[{"input":[[-2,3,-1]],"output":[0,3,0]},{"input":[[1,2]],"output":[1,2]},{"input":[[]],"output":[]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, replace every negative value with 0 and return the new list.","reference_solution":"def solve(nums):\n return [max(0,x) for x in nums]\n"}} {"submissionId":"cmsx7admc000vkup2inpxh4x0","title":"Submission PXH4X0","payload":{"test_cases":[{"input":["abc","xyz"],"output":true},{"input":["a","bb"],"output":false},{"input":["",""],"output":true}],"constraints":"0 <= lengths <= 10^5","time_limit_ms":500,"problem_statement":"Given two strings, return True if they have the same length.","reference_solution":"def solve(a,b):\n return len(a)==len(b)\n"}} {"submissionId":"cmsx7admc000wkup2g5fjfpv5","title":"Submission FJFPV5","payload":{"test_cases":[{"input":[[-1,2,4]],"output":3},{"input":[[-2,0]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the average of only the positive values. Return 0.0 if there are no positive values.","reference_solution":"def solve(nums):\n a=[x for x in nums if x>0]\n return 0.0 if not a else sum(a)/len(a)\n"}} {"submissionId":"cmsx7admc000xkup2ega9rsqs","title":"Submission A9RSQS","payload":{"test_cases":[{"input":["dbca"],"output":"a"},{"input":["Zab"],"output":"Z"},{"input":[""],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the lexicographically smallest character, or empty string for empty input.","reference_solution":"def solve(s):\n return min(s) if s else ''\n"}} {"submissionId":"cmsx7admc000ykup20pkc8owp","title":"Submission KC8OWP","payload":{"test_cases":[{"input":[123],"output":true},{"input":[99],"output":false},{"input":[-456],"output":true}],"constraints":"-10^18 <= n <= 10^18","time_limit_ms":500,"problem_statement":"Given an integer n, return True if its absolute value has exactly three decimal digits.","reference_solution":"def solve(n):\n n=abs(n)\n return 100 <= n <= 999\n"}} {"submissionId":"cmsx7admc000zkup27oz1cn8c","title":"Submission Z1CN8C","payload":{"test_cases":[{"input":[[3,11,20]],"output":11},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the first value greater than 10, or None if no such value exists.","reference_solution":"def solve(nums):\n for x in nums:\n if x>10:return x\n return None\n"}} {"submissionId":"cmsx7admc0010kup28oxal9fm","title":"Submission XAL9FM","payload":{"test_cases":[{"input":["a,b,c"],"output":"a;b;c"},{"input":["abc"],"output":"abc"},{"input":[",,"],"output":";;"}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return it with each comma replaced by a semicolon.","reference_solution":"def solve(s):\n return s.replace(',', ';')\n"}} {"submissionId":"cmsx7admc0011kup29n8z2hsm","title":"Submission 8Z2HSM","payload":{"test_cases":[{"input":[[1,2,1]],"output":true},{"input":[[1,2]],"output":false},{"input":[[]],"output":false}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return True if the first and last values are equal. Return False for empty input.","reference_solution":"def solve(nums):\n return bool(nums) and nums[0]==nums[-1]\n"}} {"submissionId":"cmsx7admc0012kup2blrl0bg8","title":"Submission RL0BG8","payload":{"test_cases":[{"input":[3],"output":[1,2,3]},{"input":[0],"output":[]},{"input":[1],"output":[1]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a positive integer n, return a list of integers from 1 to n inclusive.","reference_solution":"def solve(n):\n return list(range(1,n+1))\n"}} {"submissionId":"cmsx7admc0013kup2vnbwhasj","title":"Submission BWHASJ","payload":{"test_cases":[{"input":["a.b.c"],"output":2},{"input":["abc"],"output":0},{"input":["..."],"output":3}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the number of periods '.' it contains.","reference_solution":"def solve(s):\n return s.count('.')\n"}} {"submissionId":"cmsx7admc0014kup24ry4gl2k","title":"Submission Y4GL2K","payload":{"test_cases":[{"input":[[-7,3,5]],"output":7},{"input":[[0]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the maximum absolute value, or 0 for empty input.","reference_solution":"def solve(nums):\n return max((abs(x) for x in nums), default=0)\n"}} {"submissionId":"cmsx7admc0015kup2r8wh3ms7","title":"Submission WH3MS7","payload":{"test_cases":[{"input":["123"],"output":true},{"input":["12a"],"output":false},{"input":[""],"output":false}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return True if all characters are digits and the string is non-empty.","reference_solution":"def solve(s):\n return s.isdigit()\n"}} {"submissionId":"cmsx7admc0016kup295dqkxj1","title":"Submission DQKXJ1","payload":{"test_cases":[{"input":[1,3,2],"output":2},{"input":[5,5,1],"output":5},{"input":[-1,-3,-2],"output":-2}],"constraints":"-10^9 <= a,b,c <= 10^9","time_limit_ms":500,"problem_statement":"Given integers a, b, and c, return their median value.","reference_solution":"def solve(a,b,c):\n return sorted([a,b,c])[1]\n"}} {"submissionId":"cmsx7admc0017kup2pwvk9e2e","title":"Submission VK9E2E","payload":{"test_cases":[{"input":[["a","","b"]],"output":["a","b"]},{"input":[["",""]],"output":[]},{"input":[[]],"output":[]}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of strings, return only the non-empty strings in original order.","reference_solution":"def solve(words):\n return [w for w in words if w!='']\n"}} {"submissionId":"cmsx7admc0018kup218xkunpx","title":"Submission XKUNPX","payload":{"test_cases":[{"input":["abca"],"output":3},{"input":[""],"output":0},{"input":["aaa"],"output":1}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return the number of distinct characters it contains.","reference_solution":"def solve(s):\n return len(set(s))\n"}} {"submissionId":"cmsx7admc0019kup2ux97476i","title":"Submission 97476I","payload":{"test_cases":[{"input":[[1,2,3]],"output":3},{"input":[[5]],"output":5},{"input":[[]],"output":null}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the last value, or None if the list is empty.","reference_solution":"def solve(nums):\n return nums[-1] if nums else None\n"}} {"submissionId":"cmsx7admc001akup2p32ikydf","title":"Submission 2IKYDF","payload":{"test_cases":[{"input":[4],"output":16},{"input":[-3],"output":9},{"input":[0],"output":0}],"constraints":"-10^9 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given an integer n, return its square.","reference_solution":"def solve(n):\n return n*n\n"}} {"submissionId":"cmsx7admc001bkup2uid3kwe2","title":"Submission D3KWE2","payload":{"test_cases":[{"input":["abcdef",3],"output":"abc"},{"input":["abc",5],"output":"abc"},{"input":["abc",0],"output":""}],"constraints":"0 <= length <= 10^5; 0 <= k <= 10^9","time_limit_ms":500,"problem_statement":"Given a string and an integer k, return the first k characters. If k exceeds the length, return the whole string.","reference_solution":"def solve(s,k):\n return s[:k]\n"}} {"submissionId":"cmsx7admc001ckup27ktavbxr","title":"Submission TAVBXR","payload":{"test_cases":[{"input":[[3,4,6,9]],"output":3},{"input":[[1,2]],"output":0},{"input":[[]],"output":0}],"constraints":"0 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a list of integers, return the count of values divisible by 3.","reference_solution":"def solve(nums):\n return sum(x%3==0 for x in nums)\n"}} {"submissionId":"cmsx7admc001dkup2ww0abzum","title":"Submission 0ABZUM","payload":{"test_cases":[{"input":[" abc "],"output":"abc"},{"input":["abc"],"output":"abc"},{"input":[" "],"output":""}],"constraints":"0 <= length <= 10^5","time_limit_ms":500,"problem_statement":"Given a string, return it with leading and trailing whitespace removed.","reference_solution":"def solve(s):\n return s.strip()\n"}} {"submissionId":"cmsx8jz8r004qkup2kzap9qxw","title":"Submission AP9QXW","payload":{"test_cases":"[{\"input\": [[1, 2, 3, 4, 5, 6]], \"output\": 12}, {\"input\": [[1, 3, 5]], \"output\": 0}, {\"input\": [[]], \"output\": 0}, {\"input\": [[-2, -3, 4]], \"output\": 2}]","constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the sum of all even numbers.","reference_solution":"def solve(nums):\n return sum(x for x in nums if x % 2 == 0)\n"}} {"submissionId":"cmsx8jz8r004rkup2ycca6mhy","title":"Submission CA6MHY","payload":{"test_cases":"[{\"input\": [\"racecar\"], \"output\": true}, {\"input\": [\"Hello\"], \"output\": false}, {\"input\": [\"A\"], \"output\": true}, {\"input\": [\"Madam\"], \"output\": true}]","constraints":"1 <= length <= 10^4","time_limit_ms":1000,"problem_statement":"Given a string, return True if it is a palindrome (reads the same forwards and backwards), ignoring case, False otherwise.","reference_solution":"def solve(s):\n t = s.lower()\n return t == t[::-1]\n"}} {"submissionId":"cmsx8jz8r004skup25s6gc2ok","title":"Submission 6GC2OK","payload":{"test_cases":[{"input":[48,18],"output":6},{"input":[17,5],"output":1},{"input":[100,25],"output":25},{"input":[1,1],"output":1}],"constraints":"1 <= a, b <= 10^9","time_limit_ms":1000,"problem_statement":"Given two integers a and b, return their greatest common divisor.","reference_solution":"import math\ndef solve(a, b):\n return math.gcd(a, b)\n"}} {"submissionId":"cmsx8jz8r004tkup2ubvkako1","title":"Submission VKAKO1","payload":{"test_cases":"[{\"input\": [[3, 1, 4, 1, 5, 9, 2, 6]], \"output\": 6}, {\"input\": [[5, 5, 5]], \"output\": -1}, {\"input\": [[10]], \"output\": -1}, {\"input\": [[1, 2]], \"output\": 1}]","constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the second largest distinct value. If fewer than two distinct values exist, return -1.","reference_solution":"def solve(nums):\n distinct = sorted(set(nums), reverse=True)\n return distinct[1] if len(distinct) >= 2 else -1\n"}} {"submissionId":"cmsx8jz8r004ukup2z1sh9gq8","title":"Submission SH9GQ8","payload":{"test_cases":"[{\"input\": [\"12345\"], \"output\": 15}, {\"input\": [\"000\"], \"output\": 0}, {\"input\": [\"9\"], \"output\": 9}, {\"input\": [\"10203\"], \"output\": 6}]","constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string of digits, return the sum of all digits as an integer.","reference_solution":"def solve(s):\n return sum(int(c) for c in s)\n"}} {"submissionId":"cmsx8jz8r004vkup2cqbsm2gy","title":"Submission BSM2GY","payload":{"test_cases":"[{\"input\": [[70, 71, 69, 72, 72, 75]], \"output\": 3}, {\"input\": [[5, 5, 5, 5]], \"output\": 0}, {\"input\": [[1]], \"output\": 0}, {\"input\": [[1, 2, 3, 4, 5]], \"output\": 4}]","constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers representing daily temperatures, return the number of days where the temperature was strictly higher than the previous day.","reference_solution":"def solve(temps):\n count = 0\n for i in range(1, len(temps)):\n if temps[i] > temps[i-1]:\n count += 1\n return count\n"}} {"submissionId":"cmsx8jz8r004wkup29ogs4c2j","title":"Submission GS4C2J","payload":{"test_cases":"[{\"input\": [[\"cat\", \"elephant\", \"dog\"]], \"output\": \"elephant\"}, {\"input\": [[\"a\", \"bb\", \"cc\"]], \"output\": \"bb\"}, {\"input\": [[\"single\"]], \"output\": \"single\"}]","constraints":"1 <= n <= 10^4, 1 <= word length <= 100","time_limit_ms":1000,"problem_statement":"Given a list of words, return the longest word. If multiple words tie for longest, return the first one encountered.","reference_solution":"def solve(words):\n longest = words[0]\n for w in words[1:]:\n if len(w) > len(longest):\n longest = w\n return longest\n"}} {"submissionId":"cmsx8jz8r004xkup2g980bzbp","title":"Submission 80BZBP","payload":{"test_cases":"[{\"input\": [7], \"output\": true}, {\"input\": [1], \"output\": false}, {\"input\": [15], \"output\": false}, {\"input\": [2], \"output\": true}, {\"input\": [97], \"output\": true}]","constraints":"1 <= n <= 10^6","time_limit_ms":1000,"problem_statement":"Given an integer n, return True if n is a prime number, False otherwise.","reference_solution":"def solve(n):\n if n < 2:\n return False\n i = 2\n while i * i <= n:\n if n % i == 0:\n return False\n i += 1\n return True\n"}} {"submissionId":"cmsx8jz8r004ykup204vwu195","title":"Submission VWU195","payload":{"test_cases":"[{\"input\": [[1, 3, 5], [2, 4, 6]], \"output\": [1, 2, 3, 4, 5, 6]}, {\"input\": [[], [1, 2]], \"output\": [1, 2]}, {\"input\": [[1, 1, 1], [1]], \"output\": [1, 1, 1, 1]}]","constraints":"0 <= n, m <= 10^5","time_limit_ms":1000,"problem_statement":"Given two sorted arrays of integers, merge them into a single sorted array.","reference_solution":"def solve(a, b):\n result = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n result.append(a[i]); i += 1\n else:\n result.append(b[j]); j += 1\n result.extend(a[i:])\n result.extend(b[j:])\n return result\n"}} {"submissionId":"cmsx8jz8r004zkup2y3zrk7nw","title":"Submission ZRK7NW","payload":{"test_cases":"[{\"input\": [\"swiss\"], \"output\": \"w\"}, {\"input\": [\"aabbcc\"], \"output\": \"\"}, {\"input\": [\"z\"], \"output\": \"z\"}, {\"input\": [\"teeter\"], \"output\": \"r\"}]","constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string containing only lowercase letters, return the first non-repeating character. If none exists, return an empty string.","reference_solution":"from collections import Counter\ndef solve(s):\n counts = Counter(s)\n for c in s:\n if counts[c] == 1:\n return c\n return \"\"\n"}} {"submissionId":"cmsx8jz8r0050kup261nkh2h6","title":"Submission NKH2H6","payload":{"test_cases":"[{\"input\": [[2, 7, 11, 15], 9], \"output\": [0, 1]}, {\"input\": [[3, 2, 4], 6], \"output\": [1, 2]}, {\"input\": [[3, 3], 6], \"output\": [0, 1]}]","constraints":"2 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers and a target sum, return the indices of the two numbers that add up to the target (assume exactly one solution, index order does not matter but should reflect the earliest valid pair by first index then second).","reference_solution":"def solve(nums, target):\n seen = {}\n for i, n in enumerate(nums):\n complement = target - n\n if complement in seen:\n return [seen[complement], i]\n seen[n] = i\n return []\n"}} {"submissionId":"cmsx8jz8r0051kup2m909fz26","title":"Submission 09FZ26","payload":{"test_cases":"[{\"input\": [1], \"output\": 1}, {\"input\": [2], \"output\": 1}, {\"input\": [5], \"output\": 5}, {\"input\": [10], \"output\": 55}]","constraints":"1 <= n <= 40","time_limit_ms":1000,"problem_statement":"Given a positive integer n, return the nth Fibonacci number, where fib(1) = 1 and fib(2) = 1.","reference_solution":"def solve(n):\n a, b = 1, 1\n for _ in range(n - 1):\n a, b = b, a + b\n return a\n"}} {"submissionId":"cmsx8jz8r0052kup20d266rzr","title":"Submission 266RZR","payload":{"test_cases":"[{\"input\": [\"(a(b)c)\"], \"output\": true}, {\"input\": [\"(a(b)c\"], \"output\": false}, {\"input\": [\"a)b(\"], \"output\": false}, {\"input\": [\"\"], \"output\": true}]","constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, return True if all parentheses '(' and ')' in it are balanced, False otherwise. Ignore all other characters.","reference_solution":"def solve(s):\n depth = 0\n for c in s:\n if c == '(':\n depth += 1\n elif c == ')':\n depth -= 1\n if depth < 0:\n return False\n return depth == 0\n"}} {"submissionId":"cmsx8jz8r0053kup2787efrxi","title":"Submission 7EFRXI","payload":{"test_cases":"[{\"input\": [[1, 2, 3, 4, 5, 6, 7], 3], \"output\": [5, 6, 7, 1, 2, 3, 4]}, {\"input\": [[1, 2], 0], \"output\": [1, 2]}, {\"input\": [[1, 2, 3], 4], \"output\": [3, 1, 2]}]","constraints":"1 <= n <= 10^5, 0 <= k <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, rotate the array to the right by k steps and return the rotated array.","reference_solution":"def solve(nums, k):\n n = len(nums)\n k = k % n\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsx8jz8r0054kup2vm3u7mmd","title":"Submission 3U7MMD","payload":{"test_cases":"[{\"input\": [[-2, 1, -3, 4, -1, 2, 1, -5, 4]], \"output\": 6}, {\"input\": [[1]], \"output\": 1}, {\"input\": [[-1, -2, -3]], \"output\": -1}]","constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the maximum sum achievable from any contiguous subarray (Kadane's algorithm). Assume the array has at least one element.","reference_solution":"def solve(nums):\n best = cur = nums[0]\n for x in nums[1:]:\n cur = max(x, cur + x)\n best = max(best, cur)\n return best\n"}} {"submissionId":"cmsx8jz8r0055kup2y9i12nfq","title":"Submission I12NFQ","payload":{"test_cases":"[{\"input\": [\"listen\", \"silent\"], \"output\": true}, {\"input\": [\"hello\", \"world\"], \"output\": false}, {\"input\": [\"\", \"\"], \"output\": true}]","constraints":"1 <= length <= 10^4","time_limit_ms":1000,"problem_statement":"Given two strings, return True if the second string is an anagram of the first (same letters, same counts), False otherwise.","reference_solution":"from collections import Counter\ndef solve(s, t):\n return Counter(s) == Counter(t)\n"}} {"submissionId":"cmsx8jz8r0056kup270346n8k","title":"Submission 346N8K","payload":{"test_cases":"[{\"input\": [[[1, 2, 3], [4, 5, 6]]], \"output\": [[1, 4], [2, 5], [3, 6]]}, {\"input\": [[[1]]], \"output\": [[1]]}, {\"input\": [[[1, 2], [3, 4]]], \"output\": [[1, 3], [2, 4]]}]","constraints":"1 <= rows, cols <= 100","time_limit_ms":1000,"problem_statement":"Given a matrix (list of lists) of integers, return its transpose as a new matrix.","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix)]\n"}} {"submissionId":"cmsx8jz8r0057kup2qmhyjy18","title":"Submission HYJY18","payload":{"test_cases":"[{\"input\": [[1, 2, 2, 3, 1, 4]], \"output\": [1, 2, 3, 4]}, {\"input\": [[]], \"output\": []}, {\"input\": [[5, 5, 5]], \"output\": [5]}]","constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a list of integers, return a new list with duplicates removed while preserving the original order of first appearance.","reference_solution":"def solve(nums):\n seen = set()\n result = []\n for n in nums:\n if n not in seen:\n seen.add(n)\n result.append(n)\n return result\n"}} {"submissionId":"cmsx8jz8r0058kup2t36if1k5","title":"Submission 6IF1K5","payload":{"test_cases":"[{\"input\": [0], \"output\": 1}, {\"input\": [5], \"output\": 120}, {\"input\": [10], \"output\": 3628800}]","constraints":"0 <= n <= 20","time_limit_ms":1000,"problem_statement":"Given an integer n, return the factorial of n. Assume n is non-negative and small enough that the result fits in standard integer arithmetic.","reference_solution":"def solve(n):\n result = 1\n for i in range(2, n + 1):\n result *= i\n return result\n"}} {"submissionId":"cmsx8jz8r0059kup2tyq0rjbd","title":"Submission Q0RJBD","payload":{"test_cases":"[{\"input\": [[1, 3, 5, 7, 9], 7], \"output\": true}, {\"input\": [[1, 3, 5, 7, 9], 4], \"output\": false}, {\"input\": [[], 1], \"output\": false}]","constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sorted array of integers and a target value, return True if the target exists in the array using binary search, False otherwise.","reference_solution":"def solve(nums, target):\n lo, hi = 0, len(nums) - 1\n while lo <= hi:\n mid = (lo + hi) // 2\n if nums[mid] == target:\n return True\n elif nums[mid] < target:\n lo = mid + 1\n else:\n hi = mid - 1\n return False\n"}} {"submissionId":"cmsx8jz8r005akup2pzx7wzk3","title":"Submission X7WZK3","payload":{"test_cases":"[{\"input\": [\"the sky is blue\"], \"output\": \"blue is sky the\"}, {\"input\": [\"hello\"], \"output\": \"hello\"}, {\"input\": [\"a b c\"], \"output\": \"c b a\"}]","constraints":"1 <= length <= 10^4","time_limit_ms":1000,"problem_statement":"Given a string representing a sentence, reverse the order of the words but keep each word's letters in order. Words are separated by single spaces with no leading/trailing spaces.","reference_solution":"def solve(s):\n return ' '.join(s.split(' ')[::-1])\n"}} {"submissionId":"cmsx8jz8r005bkup2wjagd7dx","title":"Submission AGD7DX","payload":{"test_cases":"[{\"input\": [[7, 1, 5, 3, 6, 4]], \"output\": 5}, {\"input\": [[7, 6, 4, 3, 1]], \"output\": 0}, {\"input\": [[2, 4, 1]], \"output\": 2}]","constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers representing stock prices by day, return the maximum profit achievable by buying on one day and selling on a later day. Return 0 if no profit is possible.","reference_solution":"def solve(prices):\n if not prices:\n return 0\n min_price = prices[0]\n best = 0\n for p in prices[1:]:\n best = max(best, p - min_price)\n min_price = min(min_price, p)\n return best\n"}} {"submissionId":"cmsx8jz8r005ckup2juv0kx5i","title":"Submission V0KX5I","payload":{"test_cases":"[{\"input\": [[1, 2, 3, 1]], \"output\": true}, {\"input\": [[1, 2, 3]], \"output\": false}, {\"input\": [[]], \"output\": false}]","constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an integer array, return True if it contains any duplicate value, False otherwise.","reference_solution":"def solve(nums):\n return len(nums) != len(set(nums))\n"}} {"submissionId":"cmsx8jz8r005dkup2oaudso79","title":"Submission UDSO79","payload":{"test_cases":"[{\"input\": [11], \"output\": 3}, {\"input\": [0], \"output\": 0}, {\"input\": [255], \"output\": 8}, {\"input\": [1024], \"output\": 1}]","constraints":"0 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return the number of set bits (1s) in its binary representation.","reference_solution":"def solve(n):\n return bin(n).count('1')\n"}} {"submissionId":"cmsx8jz8r005ekup2bwel6kub","title":"Submission EL6KUB","payload":{"test_cases":"[{\"input\": [[[1, 6], [2, 6], [8, 10], [15, 18]]], \"output\": [[1, 6], [8, 10], [15, 18]]}, {\"input\": [[[1, 5], [4, 5]]], \"output\": [[1, 5]]}, {\"input\": [[]], \"output\": []}]","constraints":"0 <= n <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of intervals as [start, end] pairs, merge all overlapping intervals and return the merged list sorted by start.","reference_solution":"def solve(intervals):\n if not intervals:\n return []\n intervals = sorted(intervals, key=lambda x: x[0])\n merged = [intervals[0]]\n for start, end in intervals[1:]:\n last = merged[-1]\n if start <= last[1]:\n last[1] = max(last[1], end)\n else:\n merged.append([start, end])\n return merged\n"}} {"submissionId":"cmsx8jz8r005fkup20mzosg06","title":"Submission ZOSG06","payload":{"test_cases":"[{\"input\": [[2, 2, 1, 1, 1, 2, 2]], \"output\": 2}, {\"input\": [[1]], \"output\": 1}, {\"input\": [[3, 3, 4, 2, 3, 3, 3]], \"output\": 3}]","constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the majority element that appears more than n/2 times. Assume a majority element always exists.","reference_solution":"def solve(nums):\n count = 0\n candidate = None\n for n in nums:\n if count == 0:\n candidate = n\n count += 1 if n == candidate else -1\n return candidate\n"}} {"submissionId":"cmsx8jz8r005gkup2sev8layj","title":"Submission V8LAYJ","payload":{"test_cases":[{"input":["aaabbbcc"],"output":"a3b3c2"},{"input":["abc"],"output":"abc"},{"input":["aaaa"],"output":"a4"},{"input":["aaab"],"output":"aaab"}],"constraints":"1 <= length <= 10^4","time_limit_ms":1000,"problem_statement":"Given a string of lowercase letters, compress it using counts of consecutive repeated characters (e.g. 'aaabbbcc' -> 'a3b3c2'). If the compressed string is not shorter than the original, return the original string unchanged (e.g. 'aaab' -> 'aaab', since 'a3b1' is not shorter).","reference_solution":"def solve(s):\n if not s:\n return s\n result = []\n count = 1\n prev = s[0]\n for c in s[1:]:\n if c == prev:\n count += 1\n else:\n result.append(prev + str(count))\n prev = c\n count = 1\n result.append(prev + str(count))\n compressed = ''.join(result)\n return compressed if len(compressed) < len(s) else s\n"}} {"submissionId":"cmsx8jz8r005hkup2iif7zvm7","title":"Submission F7ZVM7","payload":{"test_cases":"[{\"input\": [[0, 1, 2, 4]], \"output\": 3}, {\"input\": [[1, 2, 3]], \"output\": 0}, {\"input\": [[]], \"output\": 0}, {\"input\": [[0, 1, 2, 3]], \"output\": 4}]","constraints":"0 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers sorted in ascending order, return the smallest missing non-negative integer that is not present in the sorted range starting from 0. Assume the array contains only non-negative distinct integers.","reference_solution":"def solve(nums):\n s = set(nums)\n i = 0\n while i in s:\n i += 1\n return i\n"}} {"submissionId":"cmsx8jz8r005ikup206nv8bjw","title":"Submission NV8BJW","payload":{"test_cases":"[{\"input\": [\"123\", \"456\"], \"output\": \"579\"}, {\"input\": [\"99\", \"1\"], \"output\": \"100\"}, {\"input\": [\"0\", \"0\"], \"output\": \"0\"}]","constraints":"1 <= length <= 200","time_limit_ms":1000,"problem_statement":"Given two non-negative integers represented as strings, return their sum as a string (do not use built-in big-integer parsing shortcuts like int() on the whole string; simulate digit-by-digit addition).","reference_solution":"def solve(a, b):\n a, b = a[::-1], b[::-1]\n carry = 0\n result = []\n for i in range(max(len(a), len(b))):\n da = int(a[i]) if i < len(a) else 0\n db = int(b[i]) if i < len(b) else 0\n total = da + db + carry\n result.append(str(total % 10))\n carry = total // 10\n if carry:\n result.append(str(carry))\n return ''.join(result[::-1])\n"}} {"submissionId":"cmsx8jz8r005jkup2g8dmo15l","title":"Submission DMO15L","payload":{"test_cases":"[{\"input\": [[1, 2, 5], 11], \"output\": 3}, {\"input\": [[2], 3], \"output\": -1}, {\"input\": [[1], 0], \"output\": 0}]","constraints":"1 <= amount <= 10^4, 1 <= len(coins) <= 20","time_limit_ms":1000,"problem_statement":"Given an array of integers representing coin denominations and a target amount, return the minimum number of coins needed to make exactly that amount, or -1 if it cannot be made.","reference_solution":"def solve(coins, amount):\n dp = [float('inf')] * (amount + 1)\n dp[0] = 0\n for a in range(1, amount + 1):\n for c in coins:\n if c <= a:\n dp[a] = min(dp[a], dp[a-c] + 1)\n return dp[amount] if dp[amount] != float('inf') else -1\n"}} {"submissionId":"cmsx8uinm005lkup2yf10w8ii","title":"Submission 10W8II","payload":{"test_cases":[{"input":[[1,5,3]],"output":5},{"input":[[-5,-1,-10]],"output":-1},{"input":[[7]],"output":7},{"input":[[2,2,2]],"output":2}],"constraints":"1 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":1000,"problem_statement":"Given a non-empty array of integers, return the maximum element.","reference_solution":"def solve(nums):\n return max(nums)\n"}} {"submissionId":"cmsx8uinm005pkup2c8tuxxga","title":"Submission TUXXGA","payload":{"test_cases":[{"input":[0],"output":0},{"input":[1],"output":1},{"input":[5],"output":5},{"input":[10],"output":55}],"constraints":"0 <= n <= 40","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return the n-th Fibonacci number (0-indexed, fib(0)=0, fib(1)=1).","reference_solution":"def solve(n):\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a+b\n return a\n"}} {"submissionId":"cmsx8uinm005qkup2nuh0uzp9","title":"Submission H0UZP9","payload":{"test_cases":[{"input":["Hello World"],"output":3},{"input":["xyz"],"output":0},{"input":["AEIOU"],"output":5},{"input":["Programming"],"output":3}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string of lowercase and uppercase letters, count the number of vowels (a, e, i, o, u, case-insensitive).","reference_solution":"def solve(s):\n return sum(1 for c in s.lower() if c in \"aeiou\")\n"}} {"submissionId":"cmsx8uinm005skup2en38by8t","title":"Submission 38BY8T","payload":{"test_cases":[{"input":["racecar"],"output":true},{"input":["hello"],"output":false},{"input":["a"],"output":true},{"input":["abcba"],"output":true}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, determine whether it reads the same forwards and backwards (case-sensitive, no modification).","reference_solution":"def solve(s):\n return s == s[::-1]\n"}} {"submissionId":"cmsx8uinm005tkup21pum69ng","title":"Submission UM69NG","payload":{"test_cases":[{"input":[123],"output":6},{"input":[0],"output":0},{"input":[9999],"output":36},{"input":[100000],"output":1}],"constraints":"0 <= n <= 10^18","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return the sum of its decimal digits.","reference_solution":"def solve(n):\n return sum(int(d) for d in str(n))\n"}} {"submissionId":"cmsx8uinm005ukup2z8a0s584","title":"Submission A0S584","payload":{"test_cases":[{"input":["banana","a"],"output":3},{"input":["hello","l"],"output":2},{"input":["xyz","a"],"output":0},{"input":["aaaa","a"],"output":4}],"constraints":"1 <= length <= 10^5, c is a single character","time_limit_ms":1000,"problem_statement":"Given a string s and a single character c, return the number of times c occurs in s.","reference_solution":"def solve(s, c):\n return s.count(c)\n"}} {"submissionId":"cmsx8uinm005vkup2rwsqfalw","title":"Submission SQFALW","payload":{"test_cases":[{"input":[[1,5,3]],"output":3},{"input":[[10,20,30]],"output":20},{"input":[[-5,-1,-10]],"output":-5},{"input":[[100,1]],"output":1}],"constraints":"2 <= n <= 10^5, all values distinct, -10^9 <= value <= 10^9","time_limit_ms":1000,"problem_statement":"Given an array of at least two distinct integers, return the second largest value.","reference_solution":"def solve(nums):\n uniq = sorted(set(nums), reverse=True)\n return uniq[1]\n"}} {"submissionId":"cmsx8uinm005xkup2hnlsnpks","title":"Submission LSNPKS","payload":{"test_cases":[{"input":[[1,1,2,3,3,3]],"output":[1,2,3]},{"input":[[1,2,3]],"output":[1,2,3]},{"input":[[1,1,1]],"output":[1]},{"input":[[5]],"output":[5]}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sorted array of integers, return a new array with consecutive duplicates removed (only unique values remain, in order).","reference_solution":"def solve(nums):\n result = []\n for n in nums:\n if not result or result[-1] != n:\n result.append(n)\n return result\n"}} {"submissionId":"cmsx8uinm005ykup2lgo11dd2","title":"Submission O11DD2","payload":{"test_cases":[{"input":[[1,2,4,5],5],"output":3},{"input":[[2,3,4,5],5],"output":1},{"input":[[1],2],"output":2},{"input":[[1,2,3,5],5],"output":4}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array containing n-1 distinct integers from 1 to n (one number missing) and the value n, return the missing number.","reference_solution":"def solve(nums, n):\n total = n*(n+1)//2\n return total - sum(nums)\n"}} {"submissionId":"cmsx8uinm0060kup243w6lnt9","title":"Submission W6LNT9","payload":{"test_cases":[{"input":[[1,2,3,4],5],"output":2},{"input":[[1,1,1],2],"output":3},{"input":[[1,2,3],100],"output":0},{"input":[[0,0,0],0],"output":3}],"constraints":"1 <= n <= 1000, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers and a target sum, count the number of index pairs (i, j) with i < j such that nums[i] + nums[j] equals target.","reference_solution":"def solve(nums, target):\n total = 0\n for i in range(len(nums)):\n for j in range(i+1, len(nums)):\n if nums[i] + nums[j] == target:\n total += 1\n return total\n"}} {"submissionId":"cmsx8uinm0061kup2cmlcl5e1","title":"Submission LCL5E1","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],1],"output":[3,1,2]},{"input":[[1,2,3],0],"output":[1,2,3]},{"input":[[1],5],"output":[1]}],"constraints":"0 <= n <= 10^5, 0 <= k <= 10^9","time_limit_ms":1000,"problem_statement":"Given an array of integers and a non-negative integer k, rotate the array to the right by k steps and return the result.","reference_solution":"def solve(nums, k):\n if not nums:\n return nums\n k = k % len(nums)\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsx8uinm0063kup25puwkk13","title":"Submission UWKK13","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["aabb","abab"],"output":true},{"input":["a","a"],"output":true}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given two strings, determine whether they are anagrams of each other (same letters, same frequency, case-sensitive).","reference_solution":"def solve(a, b):\n return sorted(a) == sorted(b)\n"}} {"submissionId":"cmsx8uinm0064kup2kaxycxx6","title":"Submission XYCXX6","payload":{"test_cases":[{"input":["leetcode"],"output":0},{"input":["aabb"],"output":-1},{"input":["z"],"output":0},{"input":["aabbcc"],"output":-1}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, return the index of the first character that does not repeat elsewhere in the string. Return -1 if none exists.","reference_solution":"def solve(s):\n from collections import Counter\n cnt = Counter(s)\n for i, c in enumerate(s):\n if cnt[c] == 1:\n return i\n return -1\n"}} {"submissionId":"cmsx8uinm0065kup2bpo0md4g","title":"Submission O0MD4G","payload":{"test_cases":[{"input":["III"],"output":3},{"input":["LVIII"],"output":58},{"input":["MCMXCIV"],"output":1994},{"input":["IV"],"output":4}],"constraints":"1 <= length <= 15, value between 1 and 3999","time_limit_ms":1000,"problem_statement":"Given a string representing a Roman numeral (valid, using symbols I, V, X, L, C, D, M), convert it to an integer.","reference_solution":"def solve(s):\n values = {'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000}\n total = 0\n for i in range(len(s)):\n v = values[s[i]]\n if i+1 < len(s) and v < values[s[i+1]]:\n total -= v\n else:\n total += v\n return total\n"}} {"submissionId":"cmsx8uinm0066kup24bggax67","title":"Submission GGAX67","payload":{"test_cases":[{"input":["the quick brown fox"],"output":5},{"input":["a bb ccc"],"output":3},{"input":["hello"],"output":5},{"input":["x y z longestword"],"output":11}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence of space-separated words, return the length of the longest word.","reference_solution":"def solve(sentence):\n words = sentence.split()\n return max(len(w) for w in words)\n"}} {"submissionId":"cmsx8uinn0068kup2cj988wnx","title":"Submission 988WNX","payload":{"test_cases":[{"input":[2020],"output":true},{"input":[1900],"output":false},{"input":[2000],"output":true},{"input":[2023],"output":false}],"constraints":"1 <= year <= 10^5","time_limit_ms":1000,"problem_statement":"Given a year, determine whether it is a leap year according to the Gregorian calendar rules.","reference_solution":"def solve(year):\n return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)\n"}} {"submissionId":"cmsx8uinn0069kup2tpstx3gs","title":"Submission STX3GS","payload":{"test_cases":[{"input":[[3,1,2]],"output":1},{"input":[[-1,-5,-3]],"output":-5},{"input":[[7]],"output":7},{"input":[[2,2,2]],"output":2}],"constraints":"1 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":1000,"problem_statement":"Given a non-empty array of integers, return the minimum element.","reference_solution":"def solve(nums):\n return min(nums)\n"}} {"submissionId":"cmsx8uinn006bkup23x2k6lz1","title":"Submission 2K6LZ1","payload":{"test_cases":[{"input":[[1,2,2,1],[2,2]],"output":[2]},{"input":[[4,9,5],[9,4,9,8,4]],"output":[4,9]},{"input":[[1,2],[3,4]],"output":[]},{"input":[[1,1,1],[1]],"output":[1]}],"constraints":"1 <= len(a), len(b) <= 10^5","time_limit_ms":1000,"problem_statement":"Given two arrays of integers, return a sorted array of the distinct values that appear in both arrays.","reference_solution":"def solve(a, b):\n return sorted(set(a) & set(b))\n"}} {"submissionId":"cmsx8uinn006ckup2y02xtv4f","title":"Submission 2XTV4F","payload":{"test_cases":[{"input":["var_1"],"output":true},{"input":["1var"],"output":false},{"input":["_hidden"],"output":true},{"input":["bad-name"],"output":false}],"constraints":"1 <= length <= 100","time_limit_ms":1000,"problem_statement":"Given a string, determine whether it is a valid identifier: it must start with a letter or underscore, and all remaining characters must be letters, digits, or underscores.","reference_solution":"def solve(s):\n if not s:\n return False\n if not (s[0].isalpha() or s[0] == '_'):\n return False\n for c in s[1:]:\n if not (c.isalnum() or c == '_'):\n return False\n return True\n"}} {"submissionId":"cmsx8uinn006dkup2yoh9zx3l","title":"Submission H9ZX3L","payload":{"test_cases":[{"input":[[1,2,3]],"output":2},{"input":[[10,20]],"output":15},{"input":[[5]],"output":5},{"input":[[1,2,2,3]],"output":2}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a non-empty array of integers, return the average of the elements rounded to 2 decimal places.","reference_solution":"def solve(nums):\n return round(sum(nums) / len(nums), 2)\n"}} {"submissionId":"cmsx8uinn006ekup2g1evi1yq","title":"Submission EVI1YQ","payload":{"test_cases":[{"input":[12],"output":[1,2,3,4,6,12]},{"input":[1],"output":[1]},{"input":[13],"output":[1,13]},{"input":[28],"output":[1,2,4,7,14,28]}],"constraints":"1 <= n <= 10^4","time_limit_ms":1000,"problem_statement":"Given a positive integer n, return a list of all its positive divisors in increasing order.","reference_solution":"def solve(n):\n result = []\n for i in range(1, n+1):\n if n % i == 0:\n result.append(i)\n return result\n"}} {"submissionId":"cmsx8uinn006fkup27tr6zf0m","title":"Submission R6ZF0M","payload":{"test_cases":[{"input":[16],"output":true},{"input":[15],"output":false},{"input":[0],"output":true},{"input":[1],"output":true}],"constraints":"0 <= n <= 10^12","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, determine whether it is a perfect square.","reference_solution":"def solve(n):\n if n < 0:\n return False\n r = int(n**0.5)\n while r*r < n:\n r += 1\n while r*r > n:\n r -= 1\n return r*r == n\n"}} {"submissionId":"cmsx8uinn006gkup2nqzf9m0h","title":"Submission ZF9M0H","payload":{"test_cases":[{"input":[2,10],"output":1024},{"input":[3,0],"output":1},{"input":[-2,3],"output":-8},{"input":[5,3],"output":125}],"constraints":"-100 <= base <= 100, 0 <= exp <= 20","time_limit_ms":1000,"problem_statement":"Given an integer base and a non-negative integer exponent exp, compute base raised to the power exp.","reference_solution":"def solve(base, exp):\n result = 1\n for _ in range(exp):\n result *= base\n return result\n"}} {"submissionId":"cmsx8uinn006hkup2xzt80f55","title":"Submission T80F55","payload":{"test_cases":[{"input":["Hello World"],"output":7},{"input":["aeiou"],"output":0},{"input":["bcdfg"],"output":5},{"input":["Programming 123"],"output":8}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, count the number of consonant letters in it (letters that are not vowels), ignoring case and non-letter characters.","reference_solution":"def solve(s):\n return sum(1 for c in s.lower() if c.isalpha() and c not in \"aeiou\")\n"}} {"submissionId":"cmsx8uinn006ikup22a1dn2g9","title":"Submission 1DN2G9","payload":{"test_cases":[{"input":[1937],"output":9},{"input":[0],"output":0},{"input":[555],"output":5},{"input":[102030],"output":3}],"constraints":"0 <= n <= 10^18","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return the largest digit appearing in its decimal representation.","reference_solution":"def solve(n):\n return max(int(d) for d in str(n))\n"}} {"submissionId":"cmsx8uinn006jkup2i5ozwge9","title":"Submission OZWGE9","payload":{"test_cases":[{"input":["hello world","hello"],"output":true},{"input":["hello","world"],"output":false},{"input":["abc","abc"],"output":true},{"input":["abcdef","abcd"],"output":true}],"constraints":"1 <= length of s, prefix <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string s and a string prefix, determine whether s starts with prefix.","reference_solution":"def solve(s, prefix):\n return s.startswith(prefix)\n"}} {"submissionId":"cmsx8uinn006kkup228btwai7","title":"Submission BTWAI7","payload":{"test_cases":[{"input":[3],"output":14},{"input":[1],"output":1},{"input":[5],"output":55},{"input":[10],"output":385}],"constraints":"1 <= n <= 10^4","time_limit_ms":1000,"problem_statement":"Given a positive integer n, return the sum of squares of all integers from 1 to n.","reference_solution":"def solve(n):\n return sum(i*i for i in range(1, n+1))\n"}} {"submissionId":"cmsx8uinn006lkup2l8p600g6","title":"Submission P600G6","payload":{"test_cases":[{"input":[[4,2,7,1],7],"output":2},{"input":[[1,2,3],5],"output":-1},{"input":[[9,9,9],9],"output":0},{"input":[[1],1],"output":0}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an unsorted array of integers and a target value, return the index of the first occurrence of target, or -1 if it does not appear.","reference_solution":"def solve(nums, target):\n for i, v in enumerate(nums):\n if v == target:\n return i\n return -1\n"}} {"submissionId":"cmsx8uinn006mkup2ih7adxc8","title":"Submission 7ADXC8","payload":{"test_cases":[{"input":["the quick brown fox"],"output":4},{"input":["hello"],"output":1},{"input":["a b c"],"output":3},{"input":[" leading spaces"],"output":2}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence with words separated by single or multiple spaces, return the number of words in it.","reference_solution":"def solve(sentence):\n return len(sentence.split())\n"}} {"submissionId":"cmsx8uinn006nkup2jdt2glor","title":"Submission T2GLOR","payload":{"test_cases":[{"input":[15],"output":true},{"input":[9],"output":false},{"input":[30],"output":true},{"input":[7],"output":false}],"constraints":"-10^9 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given an integer n, determine whether it is a multiple of both 3 and 5.","reference_solution":"def solve(n):\n return n % 3 == 0 and n % 5 == 0\n"}} {"submissionId":"cmsx8x2fp006okup2g7115fs9","title":"Submission 115FS9","payload":{"test_cases":[{"input":[[1,2,3]],"output":6},{"input":[[-2,3,4]],"output":-24},{"input":[[5]],"output":5},{"input":[[0,4,5]],"output":0}],"constraints":"1 <= n <= 20, -20 <= value <= 20","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the product of all elements.","reference_solution":"def solve(nums):\n result = 1\n for n in nums:\n result *= n\n return result\n"}} {"submissionId":"cmsx8x2fp006pkup2x2136c1u","title":"Submission 136C1U","payload":{"test_cases":[{"input":["hello world"],"output":"Hello World"},{"input":["the quick fox"],"output":"The Quick Fox"},{"input":["single"],"output":"Single"},{"input":["a b c"],"output":"A B C"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence of space-separated lowercase words, capitalize the first letter of each word and return the resulting sentence.","reference_solution":"def solve(sentence):\n return \" \".join(w[0].upper() + w[1:] if w else w for w in sentence.split(\" \"))\n"}} {"submissionId":"cmsx8x2fp006qkup2b7bxwcdi","title":"Submission BXWCDI","payload":{"test_cases":[{"input":[12345],"output":5},{"input":[0],"output":1},{"input":[-42],"output":2},{"input":[7],"output":1}],"constraints":"-10^18 <= n <= 10^18","time_limit_ms":1000,"problem_statement":"Given an integer n (possibly negative), return the number of digits in its decimal representation, not counting a minus sign.","reference_solution":"def solve(n):\n return len(str(abs(n)))\n"}} {"submissionId":"cmsx8x2fp006rkup2pifr9hwq","title":"Submission FR9HWQ","payload":{"test_cases":[{"input":[[1,2,3,1]],"output":true},{"input":[[1,2,3]],"output":false},{"input":[[5,5]],"output":true},{"input":[[1]],"output":false}],"constraints":"1 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":1000,"problem_statement":"Given an array of integers, determine whether any value appears more than once.","reference_solution":"def solve(nums):\n seen = set()\n for n in nums:\n if n in seen:\n return True\n seen.add(n)\n return False\n"}} {"submissionId":"cmsx8x2fp006skup2vu982wa2","title":"Submission 982WA2","payload":{"test_cases":[{"input":["abc",1],"output":"bcd"},{"input":["xyz",2],"output":"zab"},{"input":["Hello, World!",3],"output":"Khoor, Zruog!"},{"input":["abz",1],"output":"bca"}],"constraints":"1 <= length <= 10^5, 0 <= k <= 25","time_limit_ms":1000,"problem_statement":"Given a string containing letters and other characters, and a non-negative integer shift k, apply a Caesar cipher: shift each letter forward by k positions in the alphabet (wrapping around), preserving case, and leave non-letter characters unchanged.","reference_solution":"def solve(s, k):\n result = []\n for c in s:\n if c.isalpha():\n base = ord('a') if c.islower() else ord('A')\n result.append(chr((ord(c) - base + k) % 26 + base))\n else:\n result.append(c)\n return \"\".join(result)\n"}} {"submissionId":"cmsx8x2fp006tkup2qhwtbaur","title":"Submission WTBAUR","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":10},{"input":[[[5]]],"output":5},{"input":[[[1,-1],[2,-2]]],"output":0},{"input":[[[0,0,0]]],"output":0}],"constraints":"1 <= rows, cols <= 100, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given a 2D array (list of lists) of integers, return the sum of all elements across the whole matrix.","reference_solution":"def solve(matrix):\n return sum(sum(row) for row in matrix)\n"}} {"submissionId":"cmsx8x2fp006ukup2iol04ufc","title":"Submission L04UFC","payload":{"test_cases":[{"input":["abcdef"],"output":true},{"input":["hello"],"output":false},{"input":["a"],"output":true},{"input":["abca"],"output":false}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, determine whether all of its characters are unique (no character repeats).","reference_solution":"def solve(s):\n return len(set(s)) == len(s)\n"}} {"submissionId":"cmsx9u9x6006vkup2lz7xuhdf","title":"Submission 7XUHDF","payload":{"test_cases":[{"input":["Hello World"],"output":3},{"input":["Programming"],"output":3},{"input":["AEIOU"],"output":5},{"input":["xyz"],"output":0},{"input":[""],"output":0}],"constraints":"0 <= len(s) <= 1000, s contains printable ASCII characters","time_limit_ms":500,"problem_statement":"Write a function that counts how many vowels (a, e, i, o, u, case-insensitive) appear in a given string.","reference_solution":"def solve(s):\n return sum(1 for c in s.lower() if c in 'aeiou')\n"}} {"submissionId":"cmsx9u9x6006wkup2ne7he8ld","title":"Submission 7HE8LD","payload":{"test_cases":[{"input":["Hello World"],"output":7},{"input":["bcdfg"],"output":5},{"input":["aeiou"],"output":0},{"input":["Python3.9"],"output":5},{"input":[""],"output":0}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Count how many consonant letters appear in a given string (ignore digits, spaces, and punctuation).","reference_solution":"def solve(s):\n vowels = set('aeiou')\n return sum(1 for c in s.lower() if c.isalpha() and c not in vowels)\n"}} {"submissionId":"cmsx9u9x6006xkup2els09q1v","title":"Submission S09Q1V","payload":{"test_cases":[{"input":["abc123"],"output":3},{"input":["2024-01-01"],"output":8},{"input":["no digits here"],"output":0},{"input":["007"],"output":3},{"input":[""],"output":0}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Count how many numeric digit characters (0-9) occur in a given string.","reference_solution":"def solve(s):\n return sum(1 for c in s if c.isdigit())\n"}} {"submissionId":"cmsx9u9x6006ykup2ferx6g1s","title":"Submission RX6G1S","payload":{"test_cases":[{"input":["Hello World"],"output":2},{"input":["ALLCAPS"],"output":7},{"input":["lowercase"],"output":0},{"input":["MiXeD CaSe"],"output":5},{"input":[""],"output":0}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Count how many uppercase letters appear in a given string.","reference_solution":"def solve(s):\n return sum(1 for c in s if c.isupper())\n"}} {"submissionId":"cmsx9u9x6006zkup2pi81x6lz","title":"Submission 81X6LZ","payload":{"test_cases":[{"input":["Hello world from Python"],"output":4},{"input":[" spaced out words "],"output":3},{"input":["single"],"output":1},{"input":[""],"output":0},{"input":["one two three four five"],"output":5}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Count the number of whitespace-separated words in a sentence.","reference_solution":"def solve(s):\n return len(s.split())\n"}} {"submissionId":"cmsx9u9x60070kup2ui5hd8z1","title":"Submission 5HD8Z1","payload":{"test_cases":[{"input":["banana","a"],"output":3},{"input":["mississippi","s"],"output":4},{"input":["hello","z"],"output":0},{"input":["aaaa","a"],"output":4},{"input":["","x"],"output":0}],"constraints":"0 <= len(s) <= 1000, ch is a single character","time_limit_ms":500,"problem_statement":"Given a string and a target character, count how many times the character occurs in the string.","reference_solution":"def solve(s, ch):\n return s.count(ch)\n"}} {"submissionId":"cmsx9u9x60071kup2zuehjrzq","title":"Submission EHJRZQ","payload":{"test_cases":[{"input":[[1,2,3,4,5,6]],"output":3},{"input":[[1,3,5]],"output":0},{"input":[[2,4,6,8]],"output":4},{"input":[[]],"output":0},{"input":[[-2,-3,-4]],"output":2}],"constraints":"0 <= len(nums) <= 1000, -10^6 <= nums[i] <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, count how many of them are even.","reference_solution":"def solve(nums):\n return sum(1 for n in nums if n % 2 == 0)\n"}} {"submissionId":"cmsx9u9x60072kup2wudg9fx0","title":"Submission DG9FX0","payload":{"test_cases":[{"input":[[1,2,3,4,5,6]],"output":3},{"input":[[1,3,5]],"output":3},{"input":[[2,4,6,8]],"output":0},{"input":[[]],"output":0},{"input":[[-3,-5,4]],"output":2}],"constraints":"0 <= len(nums) <= 1000, -10^6 <= nums[i] <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, count how many of them are odd.","reference_solution":"def solve(nums):\n return sum(1 for n in nums if n % 2 != 0)\n"}} {"submissionId":"cmsx9u9x60073kup2czaa6vu2","title":"Submission AA6VU2","payload":{"test_cases":[{"input":[[1,-2,3,-4,5]],"output":2},{"input":[[-1,-2,-3]],"output":3},{"input":[[1,2,3]],"output":0},{"input":[[]],"output":0},{"input":[[0,-1,0]],"output":1}],"constraints":"0 <= len(nums) <= 1000, -10^6 <= nums[i] <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, count how many of them are negative.","reference_solution":"def solve(nums):\n return sum(1 for n in nums if n < 0)\n"}} {"submissionId":"cmsx9u9x60074kup2uojmgu75","title":"Submission JMGU75","payload":{"test_cases":[{"input":[[1,2,3,4,5,6],2],"output":3},{"input":[[10,20,30],5],"output":3},{"input":[[1,3,5,7],2],"output":0},{"input":[[],3],"output":0},{"input":[[-4,-8,-12],4],"output":3}],"constraints":"1 <= k <= 1000, 0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and a divisor k, count how many numbers in the list are multiples of k.","reference_solution":"def solve(nums, k):\n return sum(1 for n in nums if n % k == 0)\n"}} {"submissionId":"cmsx9u9x60075kup2x3sogtxv","title":"Submission SOGTXV","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":15},{"input":[[]],"output":0},{"input":[[-1,-2,3]],"output":0},{"input":[[100]],"output":100},{"input":[[0,0,0]],"output":0}],"constraints":"0 <= len(nums) <= 1000, -10^6 <= nums[i] <= 10^6","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of all elements.","reference_solution":"def solve(nums):\n return sum(nums)\n"}} {"submissionId":"cmsx9u9x60076kup2052vx2eq","title":"Submission 2VX2EQ","payload":{"test_cases":[{"input":[[1,2,3,4,5,6]],"output":12},{"input":[[1,3,5]],"output":0},{"input":[[2,4,6]],"output":12},{"input":[[]],"output":0},{"input":[[-2,-4,3]],"output":-6}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of all the even numbers in it.","reference_solution":"def solve(nums):\n return sum(n for n in nums if n % 2 == 0)\n"}} {"submissionId":"cmsx9u9x60077kup2lts9d25o","title":"Submission S9D25O","payload":{"test_cases":[{"input":[[1,2,3,4,5,6]],"output":9},{"input":[[1,3,5]],"output":9},{"input":[[2,4,6]],"output":0},{"input":[[]],"output":0},{"input":[[-3,-5,4]],"output":-8}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of all the odd numbers in it.","reference_solution":"def solve(nums):\n return sum(n for n in nums if n % 2 != 0)\n"}} {"submissionId":"cmsx9u9x60078kup2aj094ih2","title":"Submission 094IH2","payload":{"test_cases":[{"input":[12345],"output":15},{"input":[0],"output":0},{"input":[9],"output":9},{"input":[1001],"output":2},{"input":[999999],"output":54}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return the sum of its decimal digits.","reference_solution":"def solve(n):\n return sum(int(d) for d in str(abs(n)))\n"}} {"submissionId":"cmsx9u9x60079kup2z2gv7eqm","title":"Submission GV7EQM","payload":{"test_cases":[{"input":[[1,2,3]],"output":14},{"input":[[]],"output":0},{"input":[[-2,2]],"output":8},{"input":[[5]],"output":25},{"input":[[0,0,0]],"output":0}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of the squares of each element.","reference_solution":"def solve(nums):\n return sum(x*x for x in nums)\n"}} {"submissionId":"cmsx9u9x6007akup2shly24l0","title":"Submission LY24L0","payload":{"test_cases":[{"input":[5],"output":15},{"input":[0],"output":0},{"input":[1],"output":1},{"input":[10],"output":55},{"input":[100],"output":5050}],"constraints":"0 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return the sum of all natural numbers from 1 to n inclusive.","reference_solution":"def solve(n):\n return sum(range(1, n+1))\n"}} {"submissionId":"cmsx9u9x6007bkup2zl62ka2i","title":"Submission 62KA2I","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":24},{"input":[[5]],"output":5},{"input":[[-1,2,-3]],"output":6},{"input":[[0,5,6]],"output":0},{"input":[[2,2,2,2]],"output":16}],"constraints":"1 <= len(nums) <= 20, -20 <= nums[i] <= 20","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the product of all its elements.","reference_solution":"def solve(nums):\n p = 1\n for x in nums:\n p *= x\n return p\n"}} {"submissionId":"cmsx9u9x6007ckup2n5eutqrz","title":"Submission EUTQRZ","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":2.5},{"input":[[5]],"output":5},{"input":[[1,2]],"output":1.5},{"input":[[10,20,30]],"output":20},{"input":[[-1,1]],"output":0}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the average of its elements, rounded to 2 decimal places.","reference_solution":"def solve(nums):\n return round(sum(nums)/len(nums), 2)\n"}} {"submissionId":"cmsx9u9x6007dkup2e228jwwh","title":"Submission 28JWWH","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":9},{"input":[[10,20,30,40]],"output":40},{"input":[[7]],"output":7},{"input":[[]],"output":0},{"input":[[1,1,1,1,1,1]],"output":3}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return the sum of elements located at even indices (0, 2, 4, ...).","reference_solution":"def solve(nums):\n return sum(nums[i] for i in range(0, len(nums), 2))\n"}} {"submissionId":"cmsx9u9x6007ekup2tc8wko4q","title":"Submission 8WKO4Q","payload":{"test_cases":[{"input":[[1,5,10,15],5],"output":25},{"input":[[1,2,3],10],"output":0},{"input":[[],0],"output":0},{"input":[[-1,-2,3],-1],"output":3},{"input":[[100,200],50],"output":300}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and a threshold value, return the sum of all elements strictly greater than the threshold.","reference_solution":"def solve(nums, t):\n return sum(x for x in nums if x > t)\n"}} {"submissionId":"cmsx9u9x6007fkup2ggrzflxm","title":"Submission RZFLXM","payload":{"test_cases":[{"input":[[1,5,3]],"output":5},{"input":[[-1,-5,-3]],"output":-1},{"input":[[7]],"output":7},{"input":[[2,2,2]],"output":2},{"input":[[10,20,5,20]],"output":20}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the maximum element.","reference_solution":"def solve(nums):\n return max(nums)\n"}} {"submissionId":"cmsx9u9x7007gkup2q7orgprp","title":"Submission ORGPRP","payload":{"test_cases":[{"input":[[1,5,3]],"output":1},{"input":[[-1,-5,-3]],"output":-5},{"input":[[7]],"output":7},{"input":[[2,2,2]],"output":2},{"input":[[10,20,5,20]],"output":5}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the minimum element.","reference_solution":"def solve(nums):\n return min(nums)\n"}} {"submissionId":"cmsx9u9x7007hkup20de5wsyy","title":"Submission E5WSYY","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":3},{"input":[[5,5,4,4,3]],"output":4},{"input":[[10,20]],"output":10},{"input":[[-1,-2,-3]],"output":-2},{"input":[[1,1,2,3,3]],"output":2}],"constraints":"2 <= len(set(nums)) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers with at least two distinct values, return the second largest distinct value.","reference_solution":"def solve(nums):\n uniq = sorted(set(nums))\n return uniq[-2]\n"}} {"submissionId":"cmsx9u9x7007ikup2cq5s410l","title":"Submission 5S410L","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":2},{"input":[[5,5,4,4,3]],"output":4},{"input":[[10,20]],"output":20},{"input":[[-1,-2,-3]],"output":-2},{"input":[[1,1,2,3,3]],"output":2}],"constraints":"2 <= len(set(nums)) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers with at least two distinct values, return the second smallest distinct value.","reference_solution":"def solve(nums):\n uniq = sorted(set(nums))\n return uniq[1]\n"}} {"submissionId":"cmsx9u9x7007jkup2y6uw18cj","title":"Submission UW18CJ","payload":{"test_cases":[{"input":[[1,5,3]],"output":4},{"input":[[-1,-5,-3]],"output":4},{"input":[[7]],"output":0},{"input":[[2,2,2]],"output":0},{"input":[[10,20,5,20]],"output":15}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the difference between the maximum and minimum elements.","reference_solution":"def solve(nums):\n return max(nums) - min(nums)\n"}} {"submissionId":"cmsx9u9x7007kkup2thbstz9w","title":"Submission BSTZ9W","payload":{"test_cases":[{"input":[[1,5,3,5]],"output":1},{"input":[[-1,-5,-3]],"output":0},{"input":[[7]],"output":0},{"input":[[2,2,2]],"output":0},{"input":[[10,20,5,20]],"output":1}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the index of the first occurrence of the maximum value.","reference_solution":"def solve(nums):\n return nums.index(max(nums))\n"}} {"submissionId":"cmsx9u9x7007lkup2p572gn7e","title":"Submission 72GN7E","payload":{"test_cases":[{"input":[1,2,3],"output":3},{"input":[3,2,1],"output":3},{"input":[-1,-2,-3],"output":-1},{"input":[5,5,5],"output":5},{"input":[0,-1,1],"output":1}],"constraints":"-10^9 <= a, b, c <= 10^9","time_limit_ms":500,"problem_statement":"Given three integers, return the largest of the three.","reference_solution":"def solve(a, b, c):\n return max(a, b, c)\n"}} {"submissionId":"cmsx9u9x7007mkup20gdbiv4s","title":"Submission DBIV4S","payload":{"test_cases":[{"input":["the quick brown fox"],"output":"quick"},{"input":["a bb ccc"],"output":"ccc"},{"input":["hello"],"output":"hello"},{"input":["equal size aaa bbb"],"output":"equal"},{"input":["one two three four"],"output":"three"}],"constraints":"1 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return the longest word in it. If there is a tie, return the first one encountered.","reference_solution":"def solve(sentence):\n words = sentence.split()\n return max(words, key=len)\n"}} {"submissionId":"cmsx9u9x7007nkup2ziseai0u","title":"Submission SEAI0U","payload":{"test_cases":[{"input":["the quick brown fox"],"output":"the"},{"input":["aaa bb c"],"output":"c"},{"input":["hello"],"output":"hello"},{"input":["equal size aaa bbb"],"output":"aaa"},{"input":["one two three four"],"output":"one"}],"constraints":"1 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return the shortest word in it. If there is a tie, return the first one encountered.","reference_solution":"def solve(sentence):\n words = sentence.split()\n return min(words, key=len)\n"}} {"submissionId":"cmsx9u9x7007okup266ampga5","title":"Submission AMPGA5","payload":{"test_cases":[{"input":[[1,5,3,5,5]],"output":3},{"input":[[-1,-5,-3]],"output":1},{"input":[[7]],"output":1},{"input":[[2,2,2]],"output":3},{"input":[[10,20,5,20]],"output":2}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, count how many elements are equal to the maximum value in the list.","reference_solution":"def solve(nums):\n m = max(nums)\n return nums.count(m)\n"}} {"submissionId":"cmsx9u9x7007qkup20hsyd375","title":"Submission SYD375","payload":{"test_cases":[{"input":["hello world"],"output":"olleh dlrow"},{"input":["a bb ccc"],"output":"a bb ccc"},{"input":[""],"output":""},{"input":["Python is fun"],"output":"nohtyP si nuf"},{"input":["single"],"output":"elgnis"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, reverse the letters of each word individually while keeping the word order unchanged.","reference_solution":"def solve(s):\n return ' '.join(w[::-1] for w in s.split())\n"}} {"submissionId":"cmsx9u9x7007skup2d0xxe2zl","title":"Submission XXE2ZL","payload":{"test_cases":[{"input":["HELLO"],"output":"hello"},{"input":["Hello World"],"output":"hello world"},{"input":[""],"output":""},{"input":["Python3"],"output":"python3"},{"input":["already"],"output":"already"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return it converted to lowercase.","reference_solution":"def solve(s):\n return s.lower()\n"}} {"submissionId":"cmsx9u9x7007tkup2u17kdv3m","title":"Submission 7KDV3M","payload":{"test_cases":[{"input":["hello world"],"output":"Hello World"},{"input":["THE QUICK FOX"],"output":"The Quick Fox"},{"input":[""],"output":""},{"input":["python is fun"],"output":"Python Is Fun"},{"input":["a"],"output":"A"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return it with the first letter of each word capitalized.","reference_solution":"def solve(s):\n return ' '.join(w.capitalize() for w in s.split())\n"}} {"submissionId":"cmsx9u9x7007ukup2ct7wzu3u","title":"Submission 7WZU3U","payload":{"test_cases":[{"input":["hello world"],"output":"helloworld"},{"input":[" a b c "],"output":"abc"},{"input":[""],"output":""},{"input":["no_spaces"],"output":"no_spaces"},{"input":[" \t multi space "],"output":"multispace"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return it with all whitespace characters removed.","reference_solution":"def solve(s):\n return ''.join(s.split())\n"}} {"submissionId":"cmsx9u9x7007vkup2icf6ef3r","title":"Submission F6EF3R","payload":{"test_cases":[{"input":["hello world"],"output":"hll wrld"},{"input":["AEIOU"],"output":""},{"input":[""],"output":""},{"input":["Python"],"output":"Pythn"},{"input":["xyz"],"output":"xyz"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return it with all vowels (a, e, i, o, u, case-insensitive) removed.","reference_solution":"def solve(s):\n return ''.join(c for c in s if c.lower() not in 'aeiou')\n"}} {"submissionId":"cmsx9u9x7007wkup283k2co8m","title":"Submission K2CO8M","payload":{"test_cases":[{"input":["banana","a","o"],"output":"bonono"},{"input":["hello","l","L"],"output":"heLLo"},{"input":["","x","y"],"output":""},{"input":["aaaa","a","b"],"output":"bbbb"},{"input":["test","z","q"],"output":"test"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string and two characters, replace every occurrence of the first character with the second.","reference_solution":"def solve(s, old, new):\n return s.replace(old, new)\n"}} {"submissionId":"cmsx9u9x7007xkup2ttxyak40","title":"Submission XYAK40","payload":{"test_cases":[{"input":["racecar"],"output":true},{"input":["hello"],"output":false},{"input":[""],"output":true},{"input":["a"],"output":true},{"input":["abba"],"output":true}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, determine whether it reads the same forwards and backwards (case-sensitive, no normalization).","reference_solution":"def solve(s):\n return s == s[::-1]\n"}} {"submissionId":"cmsx9u9x7007ykup2a7vfoajf","title":"Submission VFOAJF","payload":{"test_cases":[{"input":["listen","silent"],"output":true},{"input":["hello","world"],"output":false},{"input":["",""],"output":true},{"input":["abc","cab"],"output":true},{"input":["aab","aba"],"output":true}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two strings, determine whether they are anagrams of each other (same characters, same counts).","reference_solution":"def solve(a, b):\n return sorted(a) == sorted(b)\n"}} {"submissionId":"cmsx9u9x7007zkup2mzigiagv","title":"Submission IGIAGV","payload":{"test_cases":[{"input":[[1,2,3]],"output":[3,2,1]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]},{"input":[[1,1,2,2]],"output":[2,2,1,1]},{"input":[[4,3,2,1]],"output":[1,2,3,4]}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list, return it reversed.","reference_solution":"def solve(nums):\n return nums[::-1]\n"}} {"submissionId":"cmsx9u9x70080kup2nr8dnaac","title":"Submission 8DNAAC","payload":{"test_cases":[{"input":[[1,2,2,3,1]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[5,5,5]],"output":[5]},{"input":[[1,2,3]],"output":[1,2,3]},{"input":[[3,1,3,2,1]],"output":[3,1,2]}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return a new list with duplicates removed, preserving first-occurrence order.","reference_solution":"def solve(nums):\n seen = set()\n result = []\n for n in nums:\n if n not in seen:\n seen.add(n)\n result.append(n)\n return result\n"}} {"submissionId":"cmsx9u9x70081kup2oa7wchy2","title":"Submission 7WCHY2","payload":{"test_cases":[{"input":[[1,2,3],[2,3,4]],"output":[2,3]},{"input":[[1,2],[3,4]],"output":[]},{"input":[[],[1,2]],"output":[]},{"input":[[1,1,2],[2,2,3]],"output":[2]},{"input":[[5,6,7],[5,6,7]],"output":[5,6,7]}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists of integers, return a sorted list of the distinct values that appear in both.","reference_solution":"def solve(a, b):\n return sorted(set(a) & set(b))\n"}} {"submissionId":"cmsx9u9x70082kup2kovyzek3","title":"Submission VYZEK3","payload":{"test_cases":[{"input":[[1,2,3],[2,3,4]],"output":[1,2,3,4]},{"input":[[1,2],[3,4]],"output":[1,2,3,4]},{"input":[[],[1,2]],"output":[1,2]},{"input":[[1,1,2],[2,2,3]],"output":[1,2,3]},{"input":[[5,6],[5,6]],"output":[5,6]}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists of integers, return a sorted list of all distinct values that appear in either.","reference_solution":"def solve(a, b):\n return sorted(set(a) | set(b))\n"}} {"submissionId":"cmsx9u9x70083kup2cq0u3qbk","title":"Submission 0U3QBK","payload":{"test_cases":[{"input":[[1,2,3],[2,3,4]],"output":[1]},{"input":[[1,2],[3,4]],"output":[1,2]},{"input":[[],[1,2]],"output":[]},{"input":[[1,1,2],[2,2,3]],"output":[1]},{"input":[[5,6],[5,6]],"output":[]}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists of integers, return a sorted list of distinct values that are in the first list but not the second.","reference_solution":"def solve(a, b):\n return sorted(set(a) - set(b))\n"}} {"submissionId":"cmsx9u9x70084kup2m3ehc3h1","title":"Submission EHC3H1","payload":{"test_cases":[{"input":[[[1,2],[3,4],[5]]],"output":[1,2,3,4,5]},{"input":[[[]]],"output":[]},{"input":[[[1],[2],[3]]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[[1,2,3],[]]],"output":[1,2,3]}],"constraints":"0 <= total elements <= 1000","time_limit_ms":500,"problem_statement":"Given a list of lists (nested exactly one level deep), return a single flat list of all elements in order.","reference_solution":"def solve(nested):\n result = []\n for sub in nested:\n result.extend(sub)\n return result\n"}} {"submissionId":"cmsx9u9x70085kup23cja0z3b","title":"Submission JA0Z3B","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[3,4,5,1,2]},{"input":[[1,2,3],0],"output":[1,2,3]},{"input":[[1,2,3],3],"output":[1,2,3]},{"input":[[],5],"output":[]},{"input":[[1,2,3,4],5],"output":[2,3,4,1]}],"constraints":"0 <= len(nums) <= 1000, 0 <= k <= 1000","time_limit_ms":500,"problem_statement":"Given a list and an integer k, rotate the list to the left by k positions.","reference_solution":"def solve(nums, k):\n if not nums:\n return []\n k = k % len(nums)\n return nums[k:] + nums[:k]\n"}} {"submissionId":"cmsx9u9x70086kup2rlxi3g98","title":"Submission XI3G98","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[4,5,1,2,3]},{"input":[[1,2,3],0],"output":[1,2,3]},{"input":[[1,2,3],3],"output":[1,2,3]},{"input":[[],5],"output":[]},{"input":[[1,2,3,4],5],"output":[4,1,2,3]}],"constraints":"0 <= len(nums) <= 1000, 0 <= k <= 1000","time_limit_ms":500,"problem_statement":"Given a list and an integer k, rotate the list to the right by k positions.","reference_solution":"def solve(nums, k):\n if not nums:\n return []\n k = k % len(nums)\n return nums[-k:] + nums[:-k] if k else nums[:]\n"}} {"submissionId":"cmsx9u9x70087kup2b6j8z4tm","title":"Submission J8Z4TM","payload":{"test_cases":[{"input":[[1,3,5],[2,4,6]],"output":[1,2,3,4,5,6]},{"input":[[],[1,2]],"output":[1,2]},{"input":[[5,4,3],[]],"output":[3,4,5]},{"input":[[1,1],[1,1]],"output":[1,1,1,1]},{"input":[[-2,0],[-1,1]],"output":[-2,-1,0,1]}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists of integers, return a single sorted list containing all elements from both.","reference_solution":"def solve(a, b):\n return sorted(a + b)\n"}} {"submissionId":"cmsx9u9x70088kup20clk7sil","title":"Submission LK7SIL","payload":{"test_cases":[{"input":[[1,2,4,5],5],"output":3},{"input":[[2,3,4,5],5],"output":1},{"input":[[1],2],"output":2},{"input":[[1,2,3],4],"output":4},{"input":[[2],2],"output":1}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a list containing n-1 distinct integers from 1 to n and a target n, return the single missing number.","reference_solution":"def solve(nums, n):\n return n*(n+1)//2 - sum(nums)\n"}} {"submissionId":"cmsx9x5aa0089kup287bosj3t","title":"Submission BOSJ3T","payload":{"test_cases":[{"input":[[3,1,2]],"output":[1,2,3]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]},{"input":[[-1,-3,2]],"output":[-3,-1,2]},{"input":[[2,2,1,1]],"output":[1,1,2,2]}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return it sorted in ascending order.","reference_solution":"def solve(nums):\n return sorted(nums)\n"}} {"submissionId":"cmsx9x5aa008akup2y286wqq5","title":"Submission 86WQQ5","payload":{"test_cases":[{"input":[[3,1,2]],"output":[3,2,1]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]},{"input":[[-1,-3,2]],"output":[2,-1,-3]},{"input":[[2,2,1,1]],"output":[2,2,1,1]}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return it sorted in descending order.","reference_solution":"def solve(nums):\n return sorted(nums, reverse=True)\n"}} {"submissionId":"cmsx9x5aa008bkup2mzijb6el","title":"Submission IJB6EL","payload":{"test_cases":[{"input":[[1,2,3,4],3],"output":2},{"input":[[1,2,3],5],"output":-1},{"input":[[],1],"output":-1},{"input":[[5,5,5],5],"output":0},{"input":[[7,8,9],7],"output":0}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and a target value, return the index of the first occurrence of the target, or -1 if it is not present.","reference_solution":"def solve(nums, target):\n for i, x in enumerate(nums):\n if x == target:\n return i\n return -1\n"}} {"submissionId":"cmsx9x5ab008ckup2ell0n3to","title":"Submission L0N3TO","payload":{"test_cases":[{"input":[[3,1,2],2],"output":2},{"input":[[5,3,1,4,2],1],"output":1},{"input":[[7],1],"output":7},{"input":[[9,9,1],3],"output":9},{"input":[[10,20,30],2],"output":20}],"constraints":"1 <= k <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and an integer k (1-indexed), return the kth smallest element.","reference_solution":"def solve(nums, k):\n return sorted(nums)[k-1]\n"}} {"submissionId":"cmsx9x5ab008dkup2112gfj3u","title":"Submission 2GFJ3U","payload":{"test_cases":[{"input":[[1,2,3]],"output":true},{"input":[[3,2,1]],"output":false},{"input":[[]],"output":true},{"input":[[5]],"output":true},{"input":[[1,1,2,2]],"output":true}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, determine whether it is sorted in non-decreasing order.","reference_solution":"def solve(nums):\n return nums == sorted(nums)\n"}} {"submissionId":"cmsx9x5ab008ekup26mqba9e1","title":"Submission QBA9E1","payload":{"test_cases":[{"input":[[1,4,8],5],"output":4},{"input":[[10,20,30],25],"output":20},{"input":[[5],100],"output":5},{"input":[[-5,0,5],-3],"output":-5},{"input":[[1,2,3],2],"output":2}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and a target value, return the element in the list closest to the target (ties resolved by the first found).","reference_solution":"def solve(nums, target):\n return min(nums, key=lambda x: abs(x - target))\n"}} {"submissionId":"cmsx9x5ab008fkup295be5282","title":"Submission BE5282","payload":{"test_cases":[{"input":[["ccc","a","bb"]],"output":["a","bb","ccc"]},{"input":[[]],"output":[]},{"input":[["same","size"]],"output":["same","size"]},{"input":[["one"]],"output":["one"]},{"input":[["aaaa","aa","aaa","a"]],"output":["a","aa","aaa","aaaa"]}],"constraints":"0 <= len(words) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of strings, return them sorted by length, shortest first.","reference_solution":"def solve(words):\n return sorted(words, key=len)\n"}} {"submissionId":"cmsx9x5ab008gkup2ntj7nr9d","title":"Submission J7NR9D","payload":{"test_cases":[{"input":[[[1,3],[2,1],[3,2]]],"output":[[2,1],[3,2],[1,3]]},{"input":[[]],"output":[]},{"input":[[[1,1]]],"output":[[1,1]]},{"input":[[[5,9],[6,2],[7,5]]],"output":[[6,2],[7,5],[5,9]]},{"input":[[[0,0],[0,-1]]],"output":[[0,-1],[0,0]]}],"constraints":"0 <= len(pairs) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of two-element lists [a, b], return them sorted by the second element in ascending order.","reference_solution":"def solve(pairs):\n return sorted(pairs, key=lambda p: p[1])\n"}} {"submissionId":"cmsx9x5ab008hkup2v4bnet5p","title":"Submission BNET5P","payload":{"test_cases":[{"input":[[1,3,2]],"output":1},{"input":[[1,2,3]],"output":2},{"input":[[5]],"output":0},{"input":[[1,1,1]],"output":-1},{"input":[[3,1,4,1,5]],"output":0}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return the index of the first element that is strictly greater than both of its neighbors (edge elements only need to beat their single neighbor). Return -1 if none exists.","reference_solution":"def solve(nums):\n n = len(nums)\n for i in range(n):\n left_ok = (i == 0) or nums[i] > nums[i-1]\n right_ok = (i == n-1) or nums[i] > nums[i+1]\n if left_ok and right_ok:\n return i\n return -1\n"}} {"submissionId":"cmsx9x5ab008ikup24vrqs9js","title":"Submission RQS9JS","payload":{"test_cases":[{"input":[[1,3,5,7],4],"output":2},{"input":[[1,2,3],10],"output":-1},{"input":[[],1],"output":-1},{"input":[[5,5,5],5],"output":0},{"input":[[1,2,3],0],"output":0}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and a target value, scan left to right and return the index of the first element greater than or equal to the target, or -1 if none.","reference_solution":"def solve(nums, target):\n for i, x in enumerate(nums):\n if x >= target:\n return i\n return -1\n"}} {"submissionId":"cmsx9x5ab008kkup2uypqj04f","title":"Submission PQJ04F","payload":{"test_cases":[{"input":[0],"output":0},{"input":[1],"output":1},{"input":[10],"output":55},{"input":[20],"output":6765},{"input":[30],"output":832040}],"constraints":"0 <= n <= 50","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return the nth Fibonacci number (0-indexed, fib(0) = 0, fib(1) = 1).","reference_solution":"def solve(n):\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a+b\n return a\n"}} {"submissionId":"cmsx9x5ab008lkup2a8k0v5ir","title":"Submission K0V5IR","payload":{"test_cases":[{"input":[2],"output":true},{"input":[1],"output":false},{"input":[17],"output":true},{"input":[100],"output":false},{"input":[97],"output":true}],"constraints":"0 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given an integer, determine whether it is a prime number.","reference_solution":"def solve(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5)+1):\n if n % i == 0:\n return False\n return True\n"}} {"submissionId":"cmsx9x5ac008mkup2dl9do6w3","title":"Submission 9DO6W3","payload":{"test_cases":[{"input":[12,18],"output":6},{"input":[7,13],"output":1},{"input":[100,75],"output":25},{"input":[1,1],"output":1},{"input":[270,192],"output":6}],"constraints":"1 <= a, b <= 10^9","time_limit_ms":500,"problem_statement":"Given two positive integers, return their greatest common divisor.","reference_solution":"def solve(a, b):\n while b:\n a, b = b, a % b\n return a\n"}} {"submissionId":"cmsx9x5ac008nkup2nkct1fl9","title":"Submission CT1FL9","payload":{"test_cases":[{"input":[4,6],"output":12},{"input":[7,13],"output":91},{"input":[21,6],"output":42},{"input":[1,1],"output":1},{"input":[15,20],"output":60}],"constraints":"1 <= a, b <= 10^6","time_limit_ms":500,"problem_statement":"Given two positive integers, return their least common multiple.","reference_solution":"def solve(a, b):\n def gcd(x, y):\n while y:\n x, y = y, x % y\n return x\n return a * b // gcd(a, b)\n"}} {"submissionId":"cmsx9x5ac008okup24gecw270","title":"Submission ECW270","payload":{"test_cases":[{"input":[16],"output":true},{"input":[15],"output":false},{"input":[0],"output":true},{"input":[1],"output":true},{"input":[1000000],"output":true}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given an integer, determine whether it is a perfect square.","reference_solution":"def solve(n):\n if n < 0:\n return False\n r = int(n**0.5)\n return r*r == n or (r+1)*(r+1) == n\n"}} {"submissionId":"cmsx9x5ac008pkup2fb3yo93a","title":"Submission 3YO93A","payload":{"test_cases":[{"input":[153],"output":true},{"input":[123],"output":false},{"input":[9474],"output":true},{"input":[10],"output":false},{"input":[371],"output":true}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer, determine whether it is an Armstrong number (sum of its own digits each raised to the power of the digit count equals the number).","reference_solution":"def solve(n):\n digits = str(n)\n power = len(digits)\n return n == sum(int(d)**power for d in digits)\n"}} {"submissionId":"cmsx9x5ac008qkup2ijv55qr5","title":"Submission V55QR5","payload":{"test_cases":[{"input":[121],"output":true},{"input":[123],"output":false},{"input":[7],"output":true},{"input":[1221],"output":true},{"input":[10],"output":false}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given an integer, determine whether its decimal representation is a palindrome.","reference_solution":"def solve(n):\n s = str(n)\n return s == s[::-1]\n"}} {"submissionId":"cmsx9x5ac008rkup2txxr7by9","title":"Submission XR7BY9","payload":{"test_cases":[{"input":[6],"output":12},{"input":[1],"output":1},{"input":[28],"output":56},{"input":[12],"output":28},{"input":[17],"output":18}],"constraints":"1 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a positive integer, return the sum of all of its positive divisors (including itself).","reference_solution":"def solve(n):\n return sum(i for i in range(1, n+1) if n % i == 0)\n"}} {"submissionId":"cmsx9x5ac008skup2i65a96vw","title":"Submission 5A96VW","payload":{"test_cases":[{"input":[6],"output":4},{"input":[1],"output":1},{"input":[28],"output":6},{"input":[12],"output":6},{"input":[17],"output":2}],"constraints":"1 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a positive integer, return the count of its positive divisors.","reference_solution":"def solve(n):\n return sum(1 for i in range(1, n+1) if n % i == 0)\n"}} {"submissionId":"cmsx9x5ac008tkup2xdnvmcao","title":"Submission NVMCAO","payload":{"test_cases":[{"input":[7],"output":3},{"input":[0],"output":0},{"input":[255],"output":8},{"input":[1024],"output":1},{"input":[9],"output":2}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return the number of 1-bits in its binary representation.","reference_solution":"def solve(n):\n return bin(n).count('1')\n"}} {"submissionId":"cmsx9x5ac008ukup2ldicljwx","title":"Submission ICLJWX","payload":{"test_cases":[{"input":[1],"output":true},{"input":[2],"output":true},{"input":[3],"output":false},{"input":[1024],"output":true},{"input":[1023],"output":false}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer, determine whether it is a power of two.","reference_solution":"def solve(n):\n return n > 0 and (n & (n - 1)) == 0\n"}} {"submissionId":"cmsx9x5ac008vkup2eruij4eh","title":"Submission UIJ4EH","payload":{"test_cases":[{"input":[0],"output":"0"},{"input":[1],"output":"1"},{"input":[10],"output":"1010"},{"input":[255],"output":"11111111"},{"input":[1024],"output":"10000000000"}],"constraints":"0 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return its binary representation as a string (no leading '0b').","reference_solution":"def solve(n):\n return bin(n)[2:]\n"}} {"submissionId":"cmsx9x5ac008wkup2duan4820","title":"Submission AN4820","payload":{"test_cases":[{"input":["0"],"output":0},{"input":["1"],"output":1},{"input":["1010"],"output":10},{"input":["11111111"],"output":255},{"input":["100000"],"output":32}],"constraints":"1 <= len(s) <= 32","time_limit_ms":500,"problem_statement":"Given a string of '0' and '1' characters, return its decimal value.","reference_solution":"def solve(s):\n return int(s, 2)\n"}} {"submissionId":"cmsx9x5ac008xkup2unjh293r","title":"Submission JH293R","payload":{"test_cases":[{"input":[1,2],"output":[2,1]},{"input":[5,5],"output":[5,5]},{"input":[0,7],"output":[7,0]},{"input":[-1,1],"output":[1,-1]},{"input":[100,200],"output":[200,100]}],"constraints":"-10^9 <= a, b <= 10^9","time_limit_ms":500,"problem_statement":"Given two integers, return them swapped as [b, a] using the XOR-swap technique (no temporary variable).","reference_solution":"def solve(a, b):\n a = a ^ b\n b = a ^ b\n a = a ^ b\n return [a, b]\n"}} {"submissionId":"cmsx9x5ac008ykup2ayu4tfyi","title":"Submission U4TFYI","payload":{"test_cases":[{"input":[[2,2,1]],"output":1},{"input":[[4,1,2,1,2]],"output":4},{"input":[[1]],"output":1},{"input":[[7,3,7]],"output":3},{"input":[[9,9,5,5,3]],"output":3}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list where every element appears exactly twice except for one, return the element that appears only once.","reference_solution":"def solve(nums):\n result = 0\n for n in nums:\n result ^= n\n return result\n"}} {"submissionId":"cmsx9x5ac0090kup2zlddw1oq","title":"Submission DDW1OQ","payload":{"test_cases":[{"input":[12],"output":8},{"input":[1],"output":0},{"input":[8],"output":0},{"input":[7],"output":6},{"input":[1024],"output":0}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer, return the result of clearing (unsetting) its lowest set bit.","reference_solution":"def solve(n):\n return n & (n - 1)\n"}} {"submissionId":"cmsx9x5ac0091kup2eo488te7","title":"Submission 488TE7","payload":{"test_cases":[{"input":[12],"output":4},{"input":[1],"output":1},{"input":[8],"output":8},{"input":[7],"output":1},{"input":[1024],"output":1024}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer, return the value of its lowest set bit (as an integer).","reference_solution":"def solve(n):\n return n & (-n)\n"}} {"submissionId":"cmsx9x5ac0092kup2bujbdori","title":"Submission JBDORI","payload":{"test_cases":[{"input":[8],"output":3},{"input":[1],"output":0},{"input":[12],"output":2},{"input":[1024],"output":10},{"input":[7],"output":0}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer, return the number of trailing zero bits in its binary representation.","reference_solution":"def solve(n):\n count = 0\n while n % 2 == 0:\n n //= 2\n count += 1\n return count\n"}} {"submissionId":"cmsx9x5ac0093kup2hegozupd","title":"Submission GOZUPD","payload":{"test_cases":[{"input":[15],"output":"FizzBuzz"},{"input":[3],"output":"Fizz"},{"input":[5],"output":"Buzz"},{"input":[7],"output":"7"},{"input":[1],"output":"1"}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given an integer n, return 'Fizz' if divisible by 3, 'Buzz' if divisible by 5, 'FizzBuzz' if divisible by both, otherwise the number as a string.","reference_solution":"def solve(n):\n if n % 15 == 0:\n return 'FizzBuzz'\n elif n % 3 == 0:\n return 'Fizz'\n elif n % 5 == 0:\n return 'Buzz'\n return str(n)\n"}} {"submissionId":"cmsx9x5ad0094kup289z8t8j2","title":"Submission Z8T8J2","payload":{"test_cases":[{"input":[2000],"output":true},{"input":[1900],"output":false},{"input":[2024],"output":true},{"input":[2023],"output":false},{"input":[2400],"output":true}],"constraints":"1 <= year <= 9999","time_limit_ms":500,"problem_statement":"Given a year, determine whether it is a leap year in the Gregorian calendar.","reference_solution":"def solve(year):\n return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)\n"}} {"submissionId":"cmsx9x5ad0095kup2944hti3g","title":"Submission 4HTI3G","payload":{"test_cases":[{"input":[0],"output":32},{"input":[100],"output":212},{"input":[37],"output":98.6},{"input":[-40],"output":-40},{"input":[20],"output":68}],"constraints":"-273 <= c <= 1000","time_limit_ms":500,"problem_statement":"Given a temperature in Celsius, convert it to Fahrenheit, rounded to 2 decimal places.","reference_solution":"def solve(c):\n return round(c * 9/5 + 32, 2)\n"}} {"submissionId":"cmsx9x5ad0096kup266jbo5u8","title":"Submission JBO5U8","payload":{"test_cases":[{"input":[32],"output":0},{"input":[212],"output":100},{"input":[98.6],"output":37},{"input":[-40],"output":-40},{"input":[70],"output":21.11}],"constraints":"-459 <= f <= 2000","time_limit_ms":500,"problem_statement":"Given a temperature in Fahrenheit, convert it to Celsius, rounded to 2 decimal places.","reference_solution":"def solve(f):\n return round((f - 32) * 5/9, 2)\n"}} {"submissionId":"cmsx9x5ad0097kup23ub7f6kw","title":"Submission B7F6KW","payload":{"test_cases":[{"input":[1000,5,2],"output":100},{"input":[500,10,1],"output":50},{"input":[0,5,5],"output":0},{"input":[2000,3.5,4],"output":280},{"input":[100,100,1],"output":100}],"constraints":"0 <= p, r, t <= 10^6","time_limit_ms":500,"problem_statement":"Given principal, annual rate (percent), and time in years, compute the simple interest, rounded to 2 decimal places.","reference_solution":"def solve(p, r, t):\n return round(p * r * t / 100, 2)\n"}} {"submissionId":"cmsx9x5ad0098kup2lu5e7t0z","title":"Submission 5E7T0Z","payload":{"test_cases":[{"input":[1000,5,2],"output":102.5},{"input":[500,10,1],"output":50},{"input":[0,5,5],"output":0},{"input":[2000,3.5,4],"output":295.05},{"input":[100,100,1],"output":100}],"constraints":"0 <= p, r, t <= 1000","time_limit_ms":500,"problem_statement":"Given principal, annual rate (percent), and time in years, compute the compound interest (compounded annually), rounded to 2 decimal places.","reference_solution":"def solve(p, r, t):\n return round(p * ((1 + r/100) ** t) - p, 2)\n"}} {"submissionId":"cmsx9x5ad0099kup2lackohss","title":"Submission CKOHSS","payload":{"test_cases":[{"input":[95],"output":"A"},{"input":[85],"output":"B"},{"input":[72],"output":"C"},{"input":[60],"output":"D"},{"input":[40],"output":"F"}],"constraints":"0 <= score <= 100","time_limit_ms":500,"problem_statement":"Given a numeric score (0-100), return the letter grade: A for 90+, B for 80-89, C for 70-79, D for 60-69, otherwise F.","reference_solution":"def solve(score):\n if score >= 90:\n return 'A'\n elif score >= 80:\n return 'B'\n elif score >= 70:\n return 'C'\n elif score >= 60:\n return 'D'\n return 'F'\n"}} {"submissionId":"cmsx9x5ad009akup2irort6a6","title":"Submission ORT6A6","payload":{"test_cases":[{"input":[3,4,5],"output":true},{"input":[1,1,3],"output":false},{"input":[10,10,10],"output":true},{"input":[2,2,4],"output":false},{"input":[5,6,7],"output":true}],"constraints":"1 <= a, b, c <= 10^6","time_limit_ms":500,"problem_statement":"Given the lengths of three sides, determine whether they can form a valid triangle.","reference_solution":"def solve(a, b, c):\n return a + b > c and a + c > b and b + c > a\n"}} {"submissionId":"cmsx9x5ad009bkup2l3q4aatg","title":"Submission Q4AATG","payload":{"test_cases":[{"input":[50,1.7],"output":"Underweight"},{"input":[70,1.75],"output":"Normal"},{"input":[90,1.7],"output":"Obese"},{"input":[110,1.7],"output":"Obese"},{"input":[60,1.6],"output":"Normal"}],"constraints":"1 <= weight_kg <= 500, 0.5 <= height_m <= 3","time_limit_ms":500,"problem_statement":"Given weight in kilograms and height in meters, compute BMI and return the category: Underweight (<18.5), Normal (<25), Overweight (<30), or Obese.","reference_solution":"def solve(weight_kg, height_m):\n bmi = weight_kg / (height_m ** 2)\n if bmi < 18.5:\n return 'Underweight'\n elif bmi < 25:\n return 'Normal'\n elif bmi < 30:\n return 'Overweight'\n return 'Obese'\n"}} {"submissionId":"cmsx9x5ad009ckup2g8u6zltm","title":"Submission U6ZLTM","payload":{"test_cases":[{"input":[90],"output":"1h 30m"},{"input":[0],"output":"0h 0m"},{"input":[45],"output":"0h 45m"},{"input":[125],"output":"2h 5m"},{"input":[600],"output":"10h 0m"}],"constraints":"0 <= total_minutes <= 100000","time_limit_ms":500,"problem_statement":"Given a total number of minutes, return a string formatted as 'Hh Mm' showing hours and remaining minutes.","reference_solution":"def solve(total_minutes):\n h, m = divmod(total_minutes, 60)\n return f'{h}h {m}m'\n"}} {"submissionId":"cmsx9x5ad009dkup2wj37d00b","title":"Submission 37D00B","payload":{"test_cases":[{"input":[[["push",1],["push",2],["pop"],["push",3]]],"output":[1,3]},{"input":[[["pop"]]],"output":[]},{"input":[[]],"output":[]},{"input":[[["push",1],["push",1]]],"output":[1,1]},{"input":[[["push",5],["pop"],["pop"]]],"output":[]}],"constraints":"0 <= len(ops) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of operations, each either [\"push\", value] or [\"pop\"], simulate a stack and return its final contents as a list (bottom to top).","reference_solution":"def solve(ops):\n stack = []\n for op in ops:\n if op[0] == 'push':\n stack.append(op[1])\n elif op[0] == 'pop':\n if stack:\n stack.pop()\n return stack\n"}} {"submissionId":"cmsx9x5ad009ekup2rka9cgs5","title":"Submission A9CGS5","payload":{"test_cases":[{"input":[[["enqueue",1],["enqueue",2],["dequeue"],["enqueue",3]]],"output":[2,3]},{"input":[[["dequeue"]]],"output":[]},{"input":[[]],"output":[]},{"input":[[["enqueue",1],["enqueue",1]]],"output":[1,1]},{"input":[[["enqueue",5],["dequeue"],["dequeue"]]],"output":[]}],"constraints":"0 <= len(ops) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of operations, each either [\"enqueue\", value] or [\"dequeue\"], simulate a FIFO queue and return its final contents as a list (front to back).","reference_solution":"def solve(ops):\n queue = []\n for op in ops:\n if op[0] == 'enqueue':\n queue.append(op[1])\n elif op[0] == 'dequeue':\n if queue:\n queue.pop(0)\n return queue\n"}} {"submissionId":"cmsx9x5ad009fkup2i2mkx3yw","title":"Submission MKX3YW","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":{"1":1,"2":2,"3":1}},{"input":[[]],"output":{}},{"input":[[5,5,5]],"output":{"5":3}},{"input":[[1]],"output":{"1":1}},{"input":[[3,1,2,1,3,3]],"output":{"1":2,"2":1,"3":3}}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return a dictionary mapping each distinct value (as a string key) to how many times it appears, with keys in sorted numeric order.","reference_solution":"def solve(nums):\n freq = {}\n for n in nums:\n freq[n] = freq.get(n, 0) + 1\n return {str(k): freq[k] for k in sorted(freq)}\n"}} {"submissionId":"cmsx9x5ad009gkup2979acjm7","title":"Submission 9ACJM7","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":2},{"input":[[5]],"output":5},{"input":[[1,1,2,2]],"output":1},{"input":[[3,3,3,1]],"output":3},{"input":[[-1,-1,2]],"output":-1}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the most frequently occurring value. If there is a tie, return the smallest such value.","reference_solution":"def solve(nums):\n freq = {}\n for n in nums:\n freq[n] = freq.get(n, 0) + 1\n best = max(freq.values())\n candidates = [k for k, v in freq.items() if v == best]\n return min(candidates)\n"}} {"submissionId":"cmsx9x5ad009hkup23ai9mqct","title":"Submission I9MQCT","payload":{"test_cases":[{"input":["swiss"],"output":"w"},{"input":["aabb"],"output":""},{"input":[""],"output":""},{"input":["x"],"output":"x"},{"input":["teeter"],"output":"r"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return the first character that does not repeat anywhere else in the string, or an empty string if none exists.","reference_solution":"def solve(s):\n from collections import Counter\n counts = Counter(s)\n for c in s:\n if counts[c] == 1:\n return c\n return ''\n"}} {"submissionId":"cmsx9x5ad009ikup2nsgfltzv","title":"Submission GFLTZV","payload":{"test_cases":[{"input":["swiss"],"output":"s"},{"input":["abcabc"],"output":"a"},{"input":[""],"output":""},{"input":["x"],"output":""},{"input":["teeter"],"output":"e"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return the first character that repeats later in the string, or an empty string if none exists.","reference_solution":"def solve(s):\n seen = set()\n for c in s:\n if c in seen:\n return c\n seen.add(c)\n return ''\n"}} {"submissionId":"cmsx9x5ad009jkup28ry1qdoa","title":"Submission Y1QDOA","payload":{"test_cases":[{"input":[[1,2,3,4],7],"output":true},{"input":[[1,2,3],100],"output":false},{"input":[[],5],"output":false},{"input":[[5,5],10],"output":true},{"input":[[0,0,1],0],"output":true}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and a target sum, determine whether any two distinct elements add up to the target.","reference_solution":"def solve(nums, target):\n seen = set()\n for n in nums:\n if target - n in seen:\n return True\n seen.add(n)\n return False\n"}} {"submissionId":"cmsx9x5ad009kkup2qr0g1irz","title":"Submission 0G1IRZ","payload":{"test_cases":[{"input":[[1,2,3,4],5],"output":2},{"input":[[1,1,1],2],"output":3},{"input":[[],5],"output":0},{"input":[[5,5],10],"output":1},{"input":[[0,0,1],0],"output":1}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers and a target sum, count how many index pairs (i < j) have elements summing to the target.","reference_solution":"def solve(nums, target):\n count = 0\n n = len(nums)\n for i in range(n):\n for j in range(i+1, n):\n if nums[i] + nums[j] == target:\n count += 1\n return count\n"}} {"submissionId":"cmsx9x5ad009lkup2hugin9if","title":"Submission GIN9IF","payload":{"test_cases":[{"input":[[["push",1],["push",2],["pop"],["push",3],["pop"]]],"output":[2,3]},{"input":[[["pop"]]],"output":[]},{"input":[[]],"output":[]},{"input":[[["push",1],["pop"],["pop"]]],"output":[1]},{"input":[[["push",5],["push",6],["pop"]]],"output":[6]}],"constraints":"0 <= len(ops) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of operations, each either [\"push\", value] or [\"pop\"], simulate a stack and return the sequence of values that were popped, in order.","reference_solution":"def solve(ops):\n stack = []\n popped = []\n for op in ops:\n if op[0] == 'push':\n stack.append(op[1])\n elif op[0] == 'pop':\n if stack:\n popped.append(stack.pop())\n return popped\n"}} {"submissionId":"cmsx9x5ad009mkup257dqlojr","title":"Submission DQLOJR","payload":{"test_cases":[{"input":[[["alice",90],["bob",85]]],"output":{"bob":85,"alice":90}},{"input":[[]],"output":{}},{"input":[[["a",1],["a",2]]],"output":{"a":2}},{"input":[[["x",0]]],"output":{"x":0}},{"input":[[["p",1],["q",2],["p",3]]],"output":{"p":3,"q":2}}],"constraints":"0 <= len(pairs) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of [name, score] pairs, build and return a dictionary mapping each name to its score (later duplicate names overwrite earlier ones).","reference_solution":"def solve(pairs):\n d = {}\n for name, score in pairs:\n d[name] = score\n return d\n"}} {"submissionId":"cmsx9zfsn009nkup2bzataq92","title":"Submission ATAQ92","payload":{"test_cases":[{"input":[3,4],"output":12},{"input":[5,5],"output":25},{"input":[0,10],"output":0},{"input":[1,1],"output":1},{"input":[10,2],"output":20}],"constraints":"0 <= l, w <= 10^6","time_limit_ms":500,"problem_statement":"Given the length and width of a rectangle, return its area.","reference_solution":"def solve(l, w):\n return l * w\n"}} {"submissionId":"cmsx9zfsn009okup2emur3niv","title":"Submission UR3NIV","payload":{"test_cases":[{"input":[1],"output":3.14},{"input":[0],"output":0},{"input":[5],"output":78.54},{"input":[10],"output":314.16},{"input":[2.5],"output":19.63}],"constraints":"0 <= r <= 10^6","time_limit_ms":500,"problem_statement":"Given the radius of a circle, return its area using pi = 3.14159, rounded to 2 decimal places.","reference_solution":"def solve(r):\n return round(3.14159 * r * r, 2)\n"}} {"submissionId":"cmsx9zfsn009pkup2438ie5yv","title":"Submission 8IE5YV","payload":{"test_cases":[{"input":[4,5],"output":10},{"input":[10,2],"output":10},{"input":[0,5],"output":0},{"input":[6,6],"output":18},{"input":[7,3],"output":10.5}],"constraints":"0 <= b, h <= 10^6","time_limit_ms":500,"problem_statement":"Given the base and height of a triangle, return its area.","reference_solution":"def solve(b, h):\n return 0.5 * b * h\n"}} {"submissionId":"cmsx9zfsn009qkup2qdupxnml","title":"Submission UPXNML","payload":{"test_cases":[{"input":[3,4],"output":14},{"input":[5,5],"output":20},{"input":[0,10],"output":20},{"input":[1,1],"output":4},{"input":[10,2],"output":24}],"constraints":"0 <= l, w <= 10^6","time_limit_ms":500,"problem_statement":"Given the length and width of a rectangle, return its perimeter.","reference_solution":"def solve(l, w):\n return 2 * (l + w)\n"}} {"submissionId":"cmsx9zfsn009rkup218lq29nv","title":"Submission LQ29NV","payload":{"test_cases":[{"input":[1],"output":6.28},{"input":[0],"output":0},{"input":[5],"output":31.42},{"input":[10],"output":62.83},{"input":[2.5],"output":15.71}],"constraints":"0 <= r <= 10^6","time_limit_ms":500,"problem_statement":"Given the radius of a circle, return its circumference using pi = 3.14159, rounded to 2 decimal places.","reference_solution":"def solve(r):\n return round(2 * 3.14159 * r, 2)\n"}} {"submissionId":"cmsx9zfsn009skup2vovcr567","title":"Submission VCR567","payload":{"test_cases":[{"input":[0,0,3,4],"output":5},{"input":[0,0,0,0],"output":0},{"input":[1,1,4,5],"output":5},{"input":[-1,-1,1,1],"output":2.83},{"input":[2,3,2,8],"output":5}],"constraints":"-10^6 <= coords <= 10^6","time_limit_ms":500,"problem_statement":"Given the coordinates of two points (x1, y1) and (x2, y2), return the Euclidean distance between them, rounded to 2 decimal places.","reference_solution":"def solve(x1, y1, x2, y2):\n return round(((x2-x1)**2 + (y2-y1)**2) ** 0.5, 2)\n"}} {"submissionId":"cmsx9zfsn009tkup2xxn52e8h","title":"Submission N52E8H","payload":{"test_cases":[{"input":[5,5,0,0,10,10],"output":true},{"input":[15,5,0,0,10,10],"output":false},{"input":[0,0,0,0,10,10],"output":true},{"input":[10,10,0,0,10,10],"output":true},{"input":[-1,5,0,0,10,10],"output":false}],"constraints":"-10^6 <= coords <= 10^6, x1 < x2, y1 < y2","time_limit_ms":500,"problem_statement":"Given a point (px, py) and a rectangle defined by its bottom-left (x1, y1) and top-right (x2, y2) corners, determine whether the point lies inside or on the rectangle.","reference_solution":"def solve(px, py, x1, y1, x2, y2):\n return x1 <= px <= x2 and y1 <= py <= y2\n"}} {"submissionId":"cmsx9zfsn009ukup24sfa5t6b","title":"Submission FA5T6B","payload":{"test_cases":[{"input":[0,0,4,0,0,3],"output":6},{"input":[0,0,0,0,0,0],"output":0},{"input":[1,1,2,2,3,1],"output":1},{"input":[0,0,5,0,5,5],"output":12.5},{"input":[-1,-1,1,-1,0,1],"output":2}],"constraints":"-10^6 <= coords <= 10^6","time_limit_ms":500,"problem_statement":"Given the coordinates of a triangle's three vertices, return its area using the shoelace formula, rounded to 2 decimal places.","reference_solution":"def solve(x1, y1, x2, y2, x3, y3):\n return round(abs(x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)) / 2, 2)\n"}} {"submissionId":"cmsx9zfsn009vkup2ud4la561","title":"Submission 4LA561","payload":{"test_cases":[{"input":[0,0,1,1,2,2],"output":true},{"input":[0,0,1,1,2,3],"output":false},{"input":[1,1,1,1,1,1],"output":true},{"input":[0,0,2,0,4,0],"output":true},{"input":[0,0,1,2,2,5],"output":false}],"constraints":"-10^6 <= coords <= 10^6","time_limit_ms":500,"problem_statement":"Given the coordinates of three points, determine whether they all lie on the same straight line.","reference_solution":"def solve(x1, y1, x2, y2, x3, y3):\n return (y2-y1)*(x3-x2) == (y3-y2)*(x2-x1)\n"}} {"submissionId":"cmsx9zfsn009wkup2cxjq72gr","title":"Submission JQ72GR","payload":{"test_cases":[{"input":[2,3,4],"output":24},{"input":[1,1,1],"output":1},{"input":[0,5,5],"output":0},{"input":[10,10,10],"output":1000},{"input":[5,2,3],"output":30}],"constraints":"0 <= l, w, h <= 10^4","time_limit_ms":500,"problem_statement":"Given the length, width, and height of a cuboid, return its volume.","reference_solution":"def solve(l, w, h):\n return l * w * h\n"}} {"submissionId":"cmsx9zfsn009xkup2x502m7ua","title":"Submission 02M7UA","payload":{"test_cases":[{"input":[3661],"output":"01:01:01"},{"input":[0],"output":"00:00:00"},{"input":[59],"output":"00:00:59"},{"input":[3600],"output":"01:00:00"},{"input":[7325],"output":"02:02:05"}],"constraints":"0 <= total_seconds <= 359999","time_limit_ms":500,"problem_statement":"Given a total number of seconds, return a string formatted as 'HH:MM:SS'.","reference_solution":"def solve(total_seconds):\n h = total_seconds // 3600\n m = (total_seconds % 3600) // 60\n s = total_seconds % 60\n return f'{h:02d}:{m:02d}:{s:02d}'\n"}} {"submissionId":"cmsx9zfsn009ykup25u80w2hv","title":"Submission 80W2HV","payload":{"test_cases":[{"input":[10,20],"output":10},{"input":[1,366],"output":365},{"input":[100,100],"output":0},{"input":[365,1],"output":364},{"input":[200,150],"output":50}],"constraints":"1 <= day <= 366","time_limit_ms":500,"problem_statement":"Given two day-of-year numbers, return the absolute number of days between them.","reference_solution":"def solve(day1, day2):\n return abs(day2 - day1)\n"}} {"submissionId":"cmsx9zfsn009zkup2msoqfpt5","title":"Submission OQFPT5","payload":{"test_cases":[{"input":[2024,2,29],"output":true},{"input":[2023,2,29],"output":false},{"input":[2023,4,31],"output":false},{"input":[2023,12,25],"output":true},{"input":[2023,13,1],"output":false}],"constraints":"1 <= year <= 9999, 1 <= month <= 12 (or invalid), 1 <= day","time_limit_ms":500,"problem_statement":"Given a year, month, and day, determine whether it forms a valid calendar date (accounting for leap years in February).","reference_solution":"def solve(year, month, day):\n if month < 1 or month > 12:\n return False\n days_in_month = [31,28,31,30,31,30,31,31,30,31,30,31]\n if month == 2 and (year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)):\n max_day = 29\n else:\n max_day = days_in_month[month-1]\n return 1 <= day <= max_day\n"}} {"submissionId":"cmsx9zfsn00a0kup25disfw9a","title":"Submission ISFW9A","payload":{"test_cases":[{"input":[2000,2024],"output":24},{"input":[1990,2024],"output":34},{"input":[2024,2024],"output":0},{"input":[1950,2000],"output":50},{"input":[2010,2023],"output":13}],"constraints":"0 <= birth_year <= current_year <= 9999","time_limit_ms":500,"problem_statement":"Given a birth year and the current year, return the person's age in years.","reference_solution":"def solve(birth_year, current_year):\n return current_year - birth_year\n"}} {"submissionId":"cmsx9zfsn00a1kup2iy5uxv4x","title":"Submission 5UXV4X","payload":{"test_cases":[{"input":["00:00"],"output":"12:00 AM"},{"input":["12:00"],"output":"12:00 PM"},{"input":["13:30"],"output":"01:30 PM"},{"input":["23:59"],"output":"11:59 PM"},{"input":["09:05"],"output":"09:05 AM"}],"constraints":"'00:00' <= time_str <= '23:59'","time_limit_ms":500,"problem_statement":"Given a time string in 24-hour 'HH:MM' format, convert it to 12-hour 'hh:MM AM/PM' format.","reference_solution":"def solve(time_str):\n h, m = map(int, time_str.split(':'))\n period = 'AM' if h < 12 else 'PM'\n h12 = h % 12\n if h12 == 0:\n h12 = 12\n return f'{h12:02d}:{m:02d} {period}'\n"}} {"submissionId":"cmsx9zfsn00a2kup2ytr4ye0w","title":"Submission R4YE0W","payload":{"test_cases":[{"input":["12:00 AM"],"output":"00:00"},{"input":["12:00 PM"],"output":"12:00"},{"input":["01:30 PM"],"output":"13:30"},{"input":["11:59 PM"],"output":"23:59"},{"input":["09:05 AM"],"output":"09:05"}],"constraints":"'01:00 AM' <= time_str <= '12:59 PM'","time_limit_ms":500,"problem_statement":"Given a time string in 12-hour 'hh:MM AM/PM' format, convert it to 24-hour 'HH:MM' format.","reference_solution":"def solve(time_str):\n time_part, period = time_str.split()\n h, m = map(int, time_part.split(':'))\n if period == 'AM':\n h = 0 if h == 12 else h\n else:\n h = 12 if h == 12 else h + 12\n return f'{h:02d}:{m:02d}'\n"}} {"submissionId":"cmsx9zfso00a3kup26r6dwz5s","title":"Submission 6DWZ5S","payload":{"test_cases":[{"input":[1,1,1],"output":3661},{"input":[0,0,0],"output":0},{"input":[2,30,15],"output":9015},{"input":[10,0,0],"output":36000},{"input":[0,59,59],"output":3599}],"constraints":"0 <= h, m, s <= 999","time_limit_ms":500,"problem_statement":"Given hours, minutes, and seconds, return the total number of seconds.","reference_solution":"def solve(h, m, s):\n return h * 3600 + m * 60 + s\n"}} {"submissionId":"cmsx9zfso00a4kup2ozha25b9","title":"Submission HA25B9","payload":{"test_cases":[{"input":[90,30],"output":"2h 0m"},{"input":[0,0],"output":"0h 0m"},{"input":[45,45],"output":"1h 30m"},{"input":[120,15],"output":"2h 15m"},{"input":[59,1],"output":"1h 0m"}],"constraints":"0 <= d1, d2 <= 100000","time_limit_ms":500,"problem_statement":"Given two durations in minutes, return their sum formatted as 'Hh Mm'.","reference_solution":"def solve(d1, d2):\n total = d1 + d2\n h, m = divmod(total, 60)\n return f'{h}h {m}m'\n"}} {"submissionId":"cmsx9zfso00a5kup233fkopq0","title":"Submission FKOPQ0","payload":{"test_cases":[{"input":[10],"output":[1,3]},{"input":[0],"output":[0,0]},{"input":[7],"output":[1,0]},{"input":[365],"output":[52,1]},{"input":[1],"output":[0,1]}],"constraints":"0 <= total_days <= 10^6","time_limit_ms":500,"problem_statement":"Given a total number of days, return a two-element list [weeks, remaining_days].","reference_solution":"def solve(total_days):\n w, d = divmod(total_days, 7)\n return [w, d]\n"}} {"submissionId":"cmsx9zfso00a6kup21lskd2mq","title":"Submission SKD2MQ","payload":{"test_cases":[{"input":[1500],"output":"1d 1h 0m"},{"input":[0],"output":"0d 0h 0m"},{"input":[90],"output":"0d 1h 30m"},{"input":[2880],"output":"2d 0h 0m"},{"input":[1439],"output":"0d 23h 59m"}],"constraints":"0 <= total_minutes <= 10^7","time_limit_ms":500,"problem_statement":"Given a total number of minutes, return a string formatted as 'Dd Hh Mm' showing days, hours, and remaining minutes.","reference_solution":"def solve(total_minutes):\n d, rem = divmod(total_minutes, 1440)\n h, m = divmod(rem, 60)\n return f'{d}d {h}h {m}m'\n"}} {"submissionId":"cmsx9zfso00a7kup2xujl18m2","title":"Submission JL18M2","payload":{"test_cases":[{"input":["1,2,3"],"output":6},{"input":["10, 20, 30"],"output":60},{"input":["-1,1"],"output":0},{"input":["5"],"output":5},{"input":["0,0,0"],"output":0}],"constraints":"1 <= number of values <= 1000","time_limit_ms":500,"problem_statement":"Given a comma-separated string of integers, return their sum.","reference_solution":"def solve(s):\n return sum(int(x.strip()) for x in s.split(','))\n"}} {"submissionId":"cmsx9zfso00a8kup2vz33lok7","title":"Submission 33LOK7","payload":{"test_cases":[{"input":["the Cat sat on the CAT"],"output":4},{"input":[""],"output":0},{"input":["one two three"],"output":3},{"input":["Same same SAME"],"output":1},{"input":["a b c d"],"output":4}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string of space-separated words, return the number of unique words, treating case as insignificant.","reference_solution":"def solve(s):\n return len(set(w.lower() for w in s.split()))\n"}} {"submissionId":"cmsx9zfso00a9kup2e3alwe2d","title":"Submission ALWE2D","payload":{"test_cases":[{"input":[1000],"output":"1,000"},{"input":[0],"output":"0"},{"input":[1234567],"output":"1,234,567"},{"input":[999],"output":"999"},{"input":[1000000],"output":"1,000,000"}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given a non-negative integer, return it formatted as a string with commas as thousands separators.","reference_solution":"def solve(n):\n return f'{n:,}'\n"}} {"submissionId":"cmsx9zfso00aakup2kjupf7vt","title":"Submission UPF7VT","payload":{"test_cases":[{"input":["Hello, World!"],"output":"Hello World"},{"input":["no-punct-here"],"output":"nopuncthere"},{"input":[""],"output":""},{"input":["a.b.c."],"output":"abc"},{"input":["Wow!!!"],"output":"Wow"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return it with all punctuation characters removed.","reference_solution":"def solve(s):\n import string\n return ''.join(c for c in s if c not in string.punctuation)\n"}} {"submissionId":"cmsx9zfso00abkup255shhmyk","title":"Submission SHHMYK","payload":{"test_cases":[{"input":["a1b2c3"],"output":"123"},{"input":["no digits"],"output":""},{"input":[""],"output":""},{"input":["007"],"output":"007"},{"input":["2024-01-01"],"output":"20240101"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return a new string containing only its digit characters, in order.","reference_solution":"def solve(s):\n return ''.join(c for c in s if c.isdigit())\n"}} {"submissionId":"cmsx9zfso00ackup2g0u331u5","title":"Submission U331U5","payload":{"test_cases":[{"input":["Hello World"],"output":"HW"},{"input":["ALLCAPS"],"output":"ALLCAPS"},{"input":[""],"output":""},{"input":["lowercase"],"output":""},{"input":["MiXeD"],"output":"MXD"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return a new string containing only its uppercase letters, in order.","reference_solution":"def solve(s):\n return ''.join(c for c in s if c.isupper())\n"}} {"submissionId":"cmsx9zfso00adkup21semqrgp","title":"Submission EMQRGP","payload":{"test_cases":[{"input":["abcdefgh",3],"output":["abc","def","gh"]},{"input":["",2],"output":[]},{"input":["a",5],"output":["a"]},{"input":["abcdef",2],"output":["ab","cd","ef"]},{"input":["abcdefg",1],"output":["a","b","c","d","e","f","g"]}],"constraints":"1 <= size <= 1000","time_limit_ms":500,"problem_statement":"Given a string and a chunk size, split the string into a list of substrings of that size (the last chunk may be shorter).","reference_solution":"def solve(s, size):\n return [s[i:i+size] for i in range(0, len(s), size)]\n"}} {"submissionId":"cmsx9zfso00aekup2y1czvh95","title":"Submission CZVH95","payload":{"test_cases":[{"input":[["a","b","c"],"-"],"output":"a-b-c"},{"input":[[],","],"output":""},{"input":[["single"],","],"output":"single"},{"input":[["x","y"],""],"output":"xy"},{"input":[["1","2","3"],", "],"output":"1, 2, 3"}],"constraints":"0 <= len(words) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of strings and a delimiter, return them joined into a single string using that delimiter.","reference_solution":"def solve(words, delim):\n return delim.join(words)\n"}} {"submissionId":"cmsx9zfso00afkup2odsxx1wp","title":"Submission SXX1WP","payload":{"test_cases":[{"input":["ab",5,"*"],"output":"ab***"},{"input":["hello",3,"0"],"output":"hello"},{"input":["",4,"x"],"output":"xxxx"},{"input":["test",4,"-"],"output":"test"},{"input":["a",1,"b"],"output":"a"}],"constraints":"0 <= len(s) <= 1000, 0 <= length <= 1000","time_limit_ms":500,"problem_statement":"Given a string, a target length, and a padding character, right-pad the string with the character until it reaches the target length (or return it unchanged if already long enough).","reference_solution":"def solve(s, length, char):\n return s + char * max(0, length - len(s))\n"}} {"submissionId":"cmsx9zfso00agkup2or0pv0j6","title":"Submission 0PV0J6","payload":{"test_cases":[{"input":["hello world",5],"output":"hello..."},{"input":["short",10],"output":"short"},{"input":["",3],"output":""},{"input":["exact",5],"output":"exact"},{"input":["abcdef",0],"output":"..."}],"constraints":"0 <= len(s) <= 1000, 0 <= n <= 1000","time_limit_ms":500,"problem_statement":"Given a string and a maximum length n, return the string truncated to n characters with '...' appended if it was longer than n, otherwise return it unchanged.","reference_solution":"def solve(s, n):\n if len(s) <= n:\n return s\n return s[:n] + '...'\n"}} {"submissionId":"cmsx9zfso00ahkup2z1e500is","title":"Submission E500IS","payload":{"test_cases":[{"input":[0],"output":1},{"input":[1],"output":1},{"input":[5],"output":120},{"input":[10],"output":3628800},{"input":[12],"output":479001600}],"constraints":"0 <= n <= 20","time_limit_ms":500,"problem_statement":"Using recursion, compute n! (n factorial) for a non-negative integer n.","reference_solution":"def solve(n):\n if n <= 1:\n return 1\n return n * solve(n - 1)\n"}} {"submissionId":"cmsx9zfso00aikup22x2mj03v","title":"Submission 2MJ03V","payload":{"test_cases":[{"input":[0],"output":0},{"input":[1],"output":1},{"input":[10],"output":55},{"input":[15],"output":610},{"input":[5],"output":5}],"constraints":"0 <= n <= 20","time_limit_ms":500,"problem_statement":"Using recursion, compute the nth Fibonacci number (0-indexed, fib(0)=0, fib(1)=1).","reference_solution":"def solve(n):\n if n <= 1:\n return n\n return solve(n-1) + solve(n-2)\n"}} {"submissionId":"cmsx9zfso00ajkup2seoc3kg7","title":"Submission OC3KG7","payload":{"test_cases":[{"input":[[1,2,3]],"output":6},{"input":[[]],"output":0},{"input":[[5]],"output":5},{"input":[[-1,1,-1,1]],"output":0},{"input":[[10,20,30]],"output":60}],"constraints":"0 <= len(nums) <= 500","time_limit_ms":500,"problem_statement":"Using recursion, compute the sum of a list of integers.","reference_solution":"def solve(nums):\n if not nums:\n return 0\n return nums[0] + solve(nums[1:])\n"}} {"submissionId":"cmsx9zfso00akkup2nxikf3sj","title":"Submission IKF3SJ","payload":{"test_cases":[{"input":[2,10],"output":1024},{"input":[5,0],"output":1},{"input":[3,3],"output":27},{"input":[1,20],"output":1},{"input":[-2,3],"output":-8}],"constraints":"0 <= n <= 30","time_limit_ms":500,"problem_statement":"Using recursion, compute x raised to the power n (n is a non-negative integer).","reference_solution":"def solve(x, n):\n if n == 0:\n return 1\n return x * solve(x, n - 1)\n"}} {"submissionId":"cmsx9zfso00alkup2c3qrszk2","title":"Submission QRSZK2","payload":{"test_cases":[{"input":["hello"],"output":"olleh"},{"input":[""],"output":""},{"input":["a"],"output":"a"},{"input":["racecar"],"output":"racecar"},{"input":["abcdef"],"output":"fedcba"}],"constraints":"0 <= len(s) <= 500","time_limit_ms":500,"problem_statement":"Using recursion, reverse a given string.","reference_solution":"def solve(s):\n if len(s) <= 1:\n return s\n return solve(s[1:]) + s[0]\n"}} {"submissionId":"cmsx9zfso00amkup2mwyngjqn","title":"Submission YNGJQN","payload":{"test_cases":[{"input":["racecar"],"output":true},{"input":["hello"],"output":false},{"input":[""],"output":true},{"input":["a"],"output":true},{"input":["abba"],"output":true}],"constraints":"0 <= len(s) <= 500","time_limit_ms":500,"problem_statement":"Using recursion, determine whether a string is a palindrome (case-sensitive).","reference_solution":"def solve(s):\n if len(s) <= 1:\n return True\n if s[0] != s[-1]:\n return False\n return solve(s[1:-1])\n"}} {"submissionId":"cmsx9zfso00ankup2nnpzdomq","title":"Submission PZDOMQ","payload":{"test_cases":[{"input":[12345],"output":5},{"input":[0],"output":1},{"input":[7],"output":1},{"input":[-100],"output":3},{"input":[999999],"output":6}],"constraints":"-10^12 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Using recursion, count the number of digits in a non-negative or negative integer.","reference_solution":"def solve(n):\n n = abs(n)\n if n < 10:\n return 1\n return 1 + solve(n // 10)\n"}} {"submissionId":"cmsx9zfso00aokup2zo1nf0ky","title":"Submission 1NF0KY","payload":{"test_cases":[{"input":[12,18],"output":6},{"input":[7,13],"output":1},{"input":[100,75],"output":25},{"input":[1,1],"output":1},{"input":[270,192],"output":6}],"constraints":"1 <= a, b <= 10^9","time_limit_ms":500,"problem_statement":"Using recursion (the Euclidean algorithm), compute the greatest common divisor of two positive integers.","reference_solution":"def solve(a, b):\n if b == 0:\n return a\n return solve(b, a % b)\n"}} {"submissionId":"cmsx9zfso00apkup2alk1g4oa","title":"Submission K1G4OA","payload":{"test_cases":[{"input":[[1,3,5,7,9],7],"output":3},{"input":[[1,2,3],5],"output":-1},{"input":[[],1],"output":-1},{"input":[[5],5],"output":0},{"input":[[2,4,6,8,10],2],"output":0}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Using recursion, perform a binary search for a target value in a sorted list, returning its index or -1 if not found.","reference_solution":"def solve(nums, target, lo=0, hi=None):\n if hi is None:\n hi = len(nums) - 1\n if lo > hi:\n return -1\n mid = (lo + hi) // 2\n if nums[mid] == target:\n return mid\n elif nums[mid] < target:\n return solve(nums, target, mid+1, hi)\n else:\n return solve(nums, target, lo, mid-1)\n"}} {"submissionId":"cmsx9zfso00aqkup2of2gx6lm","title":"Submission 2GX6LM","payload":{"test_cases":[{"input":[12345],"output":15},{"input":[0],"output":0},{"input":[9],"output":9},{"input":[100],"output":1},{"input":[999999],"output":54}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Using recursion, compute the sum of the digits of a non-negative integer.","reference_solution":"def solve(n):\n n = abs(n)\n if n < 10:\n return n\n return n % 10 + solve(n // 10)\n"}} {"submissionId":"cmsx9zfso00arkup2blobnyk5","title":"Submission OBNYK5","payload":{"test_cases":[{"input":[41],"output":4},{"input":[0],"output":0},{"input":[30],"output":2},{"input":[99],"output":9},{"input":[7],"output":3}],"constraints":"0 <= amount <= 10^6","time_limit_ms":500,"problem_statement":"Given an amount of cents, return the minimum number of coins needed to make that amount using denominations 25, 10, 5, and 1.","reference_solution":"def solve(amount):\n coins = [25, 10, 5, 1]\n count = 0\n for c in coins:\n count += amount // c\n amount %= c\n return count\n"}} {"submissionId":"cmsx9zfso00askup29gzohb6o","title":"Submission ZOHB6O","payload":{"test_cases":[{"input":[11],"output":3},{"input":[0],"output":0},{"input":[8],"output":3},{"input":[17],"output":4},{"input":[3],"output":2}],"constraints":"0 <= amount <= 10^6","time_limit_ms":500,"problem_statement":"Given an amount, return the minimum number of coins needed to make that amount using denominations 5, 2, and 1.","reference_solution":"def solve(amount):\n coins = [5, 2, 1]\n count = 0\n for c in coins:\n count += amount // c\n amount %= c\n return count\n"}} {"submissionId":"cmsx9zfso00atkup2v95q822j","title":"Submission 5Q822J","payload":{"test_cases":[{"input":[[5,3,8,1],10],"output":3},{"input":[[10,20],5],"output":0},{"input":[[],100],"output":0},{"input":[[1,1,1,1],3],"output":3},{"input":[[7,7,7],7],"output":1}],"constraints":"0 <= len(prices) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of item prices and a budget, greedily buy the cheapest items first and return the maximum number of items purchasable without exceeding the budget.","reference_solution":"def solve(prices, budget):\n prices = sorted(prices)\n count = 0\n for p in prices:\n if budget >= p:\n budget -= p\n count += 1\n else:\n break\n return count\n"}} {"submissionId":"cmsx9zfso00aukup2v3587vgh","title":"Submission 587VGH","payload":{"test_cases":[{"input":[8],"output":4},{"input":[0],"output":0},{"input":[15],"output":7},{"input":[1],"output":1},{"input":[100],"output":9}],"constraints":"0 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer n, using the rule 'if even divide by 2, else subtract 1', return the minimum number of steps to reach 0.","reference_solution":"def solve(n):\n steps = 0\n while n > 0:\n if n % 2 == 0:\n n //= 2\n else:\n n -= 1\n steps += 1\n return steps\n"}} {"submissionId":"cmsx9zfso00avkup25qblax63","title":"Submission BLAX63","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":6},{"input":[[]],"output":0},{"input":[[5]],"output":5},{"input":[[10,1,10,1]],"output":20},{"input":[[1,10,1,10]],"output":20}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, compute the sum of elements at even indices and the sum of elements at odd indices, and return the larger of the two sums.","reference_solution":"def solve(nums):\n sum0 = sum(nums[i] for i in range(0, len(nums), 2))\n sum1 = sum(nums[i] for i in range(1, len(nums), 2))\n return max(sum0, sum1)\n"}} {"submissionId":"cmsx9zfso00awkup2gbe4j8s1","title":"Submission E4J8S1","payload":{"test_cases":[{"input":[287],"output":8},{"input":[0],"output":0},{"input":[100],"output":1},{"input":[63],"output":5},{"input":[1],"output":1}],"constraints":"0 <= amount <= 10^7","time_limit_ms":500,"problem_statement":"Given an amount, return the minimum number of currency notes needed to make that amount using denominations 100, 50, 20, 10, 5, and 1.","reference_solution":"def solve(amount):\n notes = [100, 50, 20, 10, 5, 1]\n count = 0\n for n in notes:\n count += amount // n\n amount %= n\n return count\n"}} {"submissionId":"cmsx9zfso00axkup2vaj30vir","title":"Submission J30VIR","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":54311},{"input":[[9]],"output":9},{"input":[[0,0,1]],"output":100},{"input":[[5,5,5]],"output":555},{"input":[[1,2,3,4,5]],"output":54321}],"constraints":"1 <= len(digits) <= 15, 0 <= digit <= 9","time_limit_ms":500,"problem_statement":"Given a list of single digits, arrange them to form the largest possible integer and return it.","reference_solution":"def solve(digits):\n digits_sorted = sorted(digits, reverse=True)\n return int(''.join(str(d) for d in digits_sorted))\n"}} {"submissionId":"cmsx9zfso00aykup2ihbilsa3","title":"Submission BILSA3","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":"11345"},{"input":[[9]],"output":"9"},{"input":[[0,0,1]],"output":"001"},{"input":[[5,5,5]],"output":"555"},{"input":[[1,2,3,4,5]],"output":"12345"}],"constraints":"1 <= len(digits) <= 15, 0 <= digit <= 9","time_limit_ms":500,"problem_statement":"Given a list of single digits, arrange them to form the smallest possible number (leading zeros allowed) and return it as a string.","reference_solution":"def solve(digits):\n digits_sorted = sorted(digits)\n return ''.join(str(d) for d in digits_sorted)\n"}} {"submissionId":"cmsx9zfso00azkup2smhlkeri","title":"Submission HLKERI","payload":{"test_cases":[{"input":[[5,1,3]],"output":[1,2,0]},{"input":[[]],"output":[]},{"input":[[7]],"output":[0]},{"input":[[2,2,2]],"output":[0,1,2]},{"input":[[10,1,5,2]],"output":[1,3,2,0]}],"constraints":"0 <= len(durations) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of job durations, return the list of original job indices ordered so shorter jobs come first (shortest-job-first scheduling).","reference_solution":"def solve(durations):\n return sorted(range(len(durations)), key=lambda i: durations[i])\n"}} {"submissionId":"cmsx9zfso00b0kup2u69j2ds4","title":"Submission 9J2DS4","payload":{"test_cases":[{"input":[10,3],"output":[4,3,3]},{"input":[0,4],"output":[0,0,0,0]},{"input":[7,7],"output":[1,1,1,1,1,1,1]},{"input":[100,4],"output":[25,25,25,25]},{"input":[5,1],"output":[5]}],"constraints":"1 <= k <= 1000, 0 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given n candies and k children, distribute the candies as evenly as possible and return a list of length k showing how many candies each child gets.","reference_solution":"def solve(n, k):\n base = n // k\n remainder = n % k\n return [base + 1 if i < remainder else base for i in range(k)]\n"}} {"submissionId":"cmsxa2lvh00b2kup28o3rnqdv","title":"Submission 3RNQDV","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[[1,3],[2,4]]},{"input":[[[1,2,3]]],"output":[[1],[2],[3]]},{"input":[[[1],[2],[3]]],"output":[[1,2,3]]},{"input":[[[1,2],[3,4],[5,6]]],"output":[[1,3,5],[2,4,6]]},{"input":[[[7]]],"output":[[7]]}],"constraints":"0 <= rows, cols <= 100","time_limit_ms":500,"problem_statement":"Given a 2D matrix, return its transpose.","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix)]\n"}} {"submissionId":"cmsxa2lvi00b6kup2foe2369m","title":"Submission E2369M","payload":{"test_cases":[{"input":[[[1,2],[2,1]]],"output":true},{"input":[[[1,2],[3,1]]],"output":false},{"input":[[[5]]],"output":true},{"input":[[[1,2,3],[2,4,5],[3,5,6]]],"output":true},{"input":[[[0,1],[1,0]]],"output":true}],"constraints":"1 <= n <= 50","time_limit_ms":500,"problem_statement":"Given a square matrix, determine whether it is symmetric (equal to its own transpose).","reference_solution":"def solve(matrix):\n n = len(matrix)\n for i in range(n):\n for j in range(n):\n if matrix[i][j] != matrix[j][i]:\n return False\n return True\n"}} {"submissionId":"cmsxa2lvi00bakup2gzpf2mrx","title":"Submission PF2MRX","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[[3,1],[4,2]]},{"input":[[[5]]],"output":[[5]]},{"input":[[[1,2,3],[4,5,6],[7,8,9]]],"output":[[7,4,1],[8,5,2],[9,6,3]]},{"input":[[[1,0],[0,1]]],"output":[[0,1],[1,0]]},{"input":[[[9,8],[7,6]]],"output":[[7,9],[6,8]]}],"constraints":"1 <= n <= 50","time_limit_ms":500,"problem_statement":"Given a square matrix, return it rotated 90 degrees clockwise.","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix[::-1])]\n"}} {"submissionId":"cmsxa2lvi00bikup262q3mrvt","title":"Submission Q3MRVT","payload":{"test_cases":[{"input":["waterbottle","erbottlewat"],"output":true},{"input":["hello","world"],"output":false},{"input":["",""],"output":true},{"input":["abc","cab"],"output":true},{"input":["abcd","abdc"],"output":false}],"constraints":"0 <= len(s1), len(s2) <= 1000","time_limit_ms":500,"problem_statement":"Given two strings, determine whether the second is a rotation of the first (same length, one is a substring of the other doubled).","reference_solution":"def solve(s1, s2):\n return len(s1) == len(s2) and s2 in (s1 + s1)\n"}} {"submissionId":"cmsxa2lvi00bjkup25ibpx2da","title":"Submission BPX2DA","payload":{"test_cases":[{"input":[6],"output":true},{"input":[28],"output":true},{"input":[12],"output":false},{"input":[1],"output":false},{"input":[496],"output":true}],"constraints":"1 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a positive integer, determine whether it is a perfect number (equal to the sum of its proper divisors).","reference_solution":"def solve(n):\n if n < 1:\n return False\n return sum(i for i in range(1, n) if n % i == 0) == n\n"}} {"submissionId":"cmsxa2lvi00bkkup21zp3bra8","title":"Submission P3BRA8","payload":{"test_cases":[{"input":["(())"],"output":true},{"input":["(()"],"output":false},{"input":[""],"output":true},{"input":["())("],"output":false},{"input":["()()"],"output":true}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string containing only '(' and ')' characters, determine whether the parentheses are balanced.","reference_solution":"def solve(s):\n balance = 0\n for c in s:\n if c == '(':\n balance += 1\n elif c == ')':\n balance -= 1\n if balance < 0:\n return False\n return balance == 0\n"}} {"submissionId":"cmsxa2lvi00blkup23qq292e5","title":"Submission Q292E5","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":true},{"input":[[3,2,2,1]],"output":true},{"input":[[1,3,2]],"output":false},{"input":[[]],"output":true},{"input":[[5]],"output":true}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, determine whether it is monotonic (entirely non-increasing or entirely non-decreasing).","reference_solution":"def solve(nums):\n inc = all(nums[i] <= nums[i+1] for i in range(len(nums)-1))\n dec = all(nums[i] >= nums[i+1] for i in range(len(nums)-1))\n return inc or dec\n"}} {"submissionId":"cmsxa2lvi00bskup2btj3rhi4","title":"Submission J3RHI4","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[10,10,10]],"output":[10,20,30]}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return the list of cumulative (running) sums.","reference_solution":"def solve(nums):\n result = []\n total = 0\n for x in nums:\n total += x\n result.append(total)\n return result\n"}} {"submissionId":"cmsxa2lvi00btkup2gs5gb9w9","title":"Submission 5GB9W9","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,2,6]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]},{"input":[[2,0,3]],"output":[2,0,0]},{"input":[[1,1,1]],"output":[1,1,1]}],"constraints":"0 <= len(nums) <= 20","time_limit_ms":500,"problem_statement":"Given a list of integers, return the list of cumulative (running) products.","reference_solution":"def solve(nums):\n result = []\n total = 1\n for x in nums:\n total *= x\n result.append(total)\n return result\n"}} {"submissionId":"cmsxa2lvi00bvkup288hej8v6","title":"Submission HEJ8V6","payload":{"test_cases":[{"input":[[1,3,2,5,4]],"output":[1,3,3,5,5]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]},{"input":[[-1,-2,-3]],"output":[-1,-1,-1]},{"input":[[1,1,1]],"output":[1,1,1]}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return a list where each element is the maximum value seen so far (inclusive) up to that position.","reference_solution":"def solve(nums):\n result = []\n current_max = None\n for x in nums:\n if current_max is None or x > current_max:\n current_max = x\n result.append(current_max)\n return result\n"}} {"submissionId":"cmsxa2lvi00bxkup2s3wkz1zd","title":"Submission WKZ1ZD","payload":{"test_cases":[{"input":["the quick brown fox"],"output":5},{"input":["a bb ccc"],"output":3},{"input":["hello"],"output":5},{"input":["equal aaaa bbbb"],"output":5},{"input":["one two three four"],"output":5}],"constraints":"1 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return the length of its longest word.","reference_solution":"def solve(sentence):\n words = sentence.split()\n return max(len(w) for w in words)\n"}} {"submissionId":"cmsxa2lvi00bzkup2jerkesyh","title":"Submission RKESYH","payload":{"test_cases":[{"input":["The quick brown fox jumps over the lazy dog"],"output":true},{"input":["hello world"],"output":false},{"input":[""],"output":false},{"input":["abcdefghijklmnopqrstuvwxyz"],"output":true},{"input":["Pack my box with five dozen liquor jugs"],"output":true}],"constraints":"0 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, determine whether it contains every letter of the English alphabet at least once (case-insensitive).","reference_solution":"def solve(sentence):\n letters = set(c for c in sentence.lower() if c.isalpha())\n return len(letters) == 26\n"}} {"submissionId":"cmsxa2lvi00c1kup210x3x2ao","title":"Submission X3X2AO","payload":{"test_cases":[{"input":["the cat sat on the mat","the"],"output":"cat sat on mat"},{"input":["a a a","a"],"output":""},{"input":["","x"],"output":""},{"input":["one two three","four"],"output":"one two three"},{"input":["x x y x","x"],"output":"y"}],"constraints":"0 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence and a target word, return the sentence with all whole-word occurrences of the target removed.","reference_solution":"def solve(sentence, word):\n return ' '.join(w for w in sentence.split() if w != word)\n"}} {"submissionId":"cmsxa2lvi00c2kup2okgtc1bc","title":"Submission GTC1BC","payload":{"test_cases":[{"input":["the cat sat on the mat","the"],"output":2},{"input":["a a a","a"],"output":3},{"input":["","x"],"output":0},{"input":["one two three","four"],"output":0},{"input":["x x y x","x"],"output":3}],"constraints":"0 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence and a target word, count how many times the target word appears as a whole word.","reference_solution":"def solve(sentence, word):\n return sentence.split().count(word)\n"}} {"submissionId":"cmsxa2lvi00c3kup2ghliqc65","title":"Submission LIQC65","payload":{"test_cases":[{"input":["the cat sat on the mat"],"output":["cat","mat","on","sat","the"]},{"input":[""],"output":[]},{"input":["a a b b"],"output":["a","b"]},{"input":["z y x"],"output":["x","y","z"]},{"input":["one"],"output":["one"]}],"constraints":"0 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return a sorted list of its unique words (case-sensitive).","reference_solution":"def solve(sentence):\n return sorted(set(sentence.split()))\n"}} {"submissionId":"cmsxa2lvi00c4kup2h8iw0j7b","title":"Submission IW0J7B","payload":{"test_cases":[{"input":["hello world","wor"],"output":true},{"input":["hello world","xyz"],"output":false},{"input":["","a"],"output":false},{"input":["abcdef",""],"output":true},{"input":["case Sensitive","sensitive"],"output":false}],"constraints":"0 <= len(sentence), len(sub) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence and a substring, determine whether the sentence contains the substring.","reference_solution":"def solve(sentence, sub):\n return sub in sentence\n"}} {"submissionId":"cmsxa2lvi00c5kup2rjfv1g63","title":"Submission FV1G63","payload":{"test_cases":[{"input":["as soon as possible"],"output":"ASAP"},{"input":["hello"],"output":"H"},{"input":["a b c"],"output":"ABC"},{"input":["World Health Organization"],"output":"WHO"},{"input":["random access memory"],"output":"RAM"}],"constraints":"1 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return the initials of each word, uppercased and joined together with no spaces.","reference_solution":"def solve(sentence):\n return ''.join(w[0].upper() for w in sentence.split())\n"}} {"submissionId":"cmsxa2lvi00c6kup27ek2b4db","title":"Submission K2B4DB","payload":{"test_cases":[{"input":["aabbbcc"],"output":"b"},{"input":["x"],"output":"x"},{"input":["abcabc"],"output":"a"},{"input":["zzzyyyy"],"output":"y"},{"input":["aabb"],"output":"a"}],"constraints":"1 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty string, return the most frequently occurring character. If there is a tie, return the smallest such character.","reference_solution":"def solve(s):\n from collections import Counter\n counts = Counter(s)\n best = max(counts.values())\n candidates = sorted(k for k, v in counts.items() if v == best)\n return candidates[0]\n"}} {"submissionId":"cmsxa2lvi00c7kup2gdqkers5","title":"Submission QKERS5","payload":{"test_cases":[{"input":["swiss"],"output":["w","i"]},{"input":["aabbcc"],"output":[]},{"input":[""],"output":[]},{"input":["abcabc"],"output":[]},{"input":["teeter"],"output":["r"]}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return a list (in original order) of the characters that appear exactly once in the string.","reference_solution":"def solve(s):\n from collections import Counter\n counts = Counter(s)\n return [c for c in s if counts[c] == 1]\n"}} {"submissionId":"cmsxa2lvi00c8kup2ce22hxxk","title":"Submission 22HXXK","payload":{"test_cases":[{"input":[[1,2,2,3],[3,2,1,2]],"output":true},{"input":[[1,2],[1,2,2]],"output":false},{"input":[[],[]],"output":true},{"input":[[5,5],[5]],"output":false},{"input":[[1,1,2],[2,1,1]],"output":true}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists, determine whether they contain the same elements with the same frequencies.","reference_solution":"def solve(a, b):\n from collections import Counter\n return Counter(a) == Counter(b)\n"}} {"submissionId":"cmsxa2lvi00c9kup21gpjg7z5","title":"Submission PJG7Z5","payload":{"test_cases":[{"input":["the cat sat on the mat"],"output":{"on":1,"cat":1,"mat":1,"sat":1,"the":2}},{"input":[""],"output":{}},{"input":["a a a"],"output":{"a":3}},{"input":["x y z"],"output":{"x":1,"y":1,"z":1}},{"input":["one two one"],"output":{"one":2,"two":1}}],"constraints":"0 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return a dictionary mapping each word to how many times it appears.","reference_solution":"def solve(sentence):\n freq = {}\n for w in sentence.split():\n freq[w] = freq.get(w, 0) + 1\n return freq\n"}} {"submissionId":"cmsxa2lvi00cakup2mrnn2by6","title":"Submission NN2BY6","payload":{"test_cases":[{"input":[{"a":1,"b":2},{"b":3}],"output":["a"]},{"input":[{},{"x":1}],"output":[]},{"input":[{"a":1},{}],"output":["a"]},{"input":[{"x":1,"y":2},{"x":1,"y":2}],"output":[]},{"input":[{"p":1,"q":2,"r":3},{"q":9}],"output":["p","r"]}],"constraints":"0 <= len(d1), len(d2) <= 1000","time_limit_ms":500,"problem_statement":"Given two dictionaries, return a sorted list of keys that appear in the first but not the second.","reference_solution":"def solve(d1, d2):\n return sorted(set(d1.keys()) - set(d2.keys()))\n"}} {"submissionId":"cmsxa2lvi00cbkup237qrcdct","title":"Submission QRCDCT","payload":{"test_cases":[{"input":[{"a":1,"b":2},{"b":3,"c":4}],"output":{"a":1,"b":5,"c":4}},{"input":[{},{"x":1}],"output":{"x":1}},{"input":[{"a":1},{}],"output":{"a":1}},{"input":[{"x":1},{"x":1}],"output":{"x":2}},{"input":[{"p":5},{"p":5,"q":2}],"output":{"p":10,"q":2}}],"constraints":"0 <= len(d1), len(d2) <= 1000","time_limit_ms":500,"problem_statement":"Given two dictionaries mapping keys to numbers, merge them into one, summing values for keys that appear in both.","reference_solution":"def solve(d1, d2):\n result = dict(d1)\n for k, v in d2.items():\n result[k] = result.get(k, 0) + v\n return result\n"}} {"submissionId":"cmsxa2lvi00cdkup2kha59x3r","title":"Submission A59X3R","payload":{"test_cases":[{"input":[{"a":1,"b":5,"c":3}],"output":"b"},{"input":[{"x":10}],"output":"x"},{"input":[{"p":1,"q":1}],"output":"p"},{"input":[{"m":-1,"n":-5}],"output":"m"},{"input":[{"y":99,"z":100}],"output":"z"}],"constraints":"1 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty dictionary of numbers, return the key with the maximum value.","reference_solution":"def solve(d):\n return max(d, key=d.get)\n"}} {"submissionId":"cmsxa2lvi00cekup2j3d0mei3","title":"Submission D0MEI3","payload":{"test_cases":[{"input":[{"a":1,"b":5,"c":10},4],"output":2},{"input":[{},0],"output":0},{"input":[{"x":1},5],"output":0},{"input":[{"p":10,"q":20},0],"output":2},{"input":[{"m":-1,"n":1},-5],"output":2}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary of numbers and a threshold, count how many keys have a value strictly greater than the threshold.","reference_solution":"def solve(d, threshold):\n return sum(1 for v in d.values() if v > threshold)\n"}} {"submissionId":"cmsxa5bp600cfkup2q36reoh1","title":"Submission 6REOH1","payload":{"test_cases":[{"input":[[["alice",80],["bob",90],["alice",95]]],"output":{"bob":90,"alice":95}},{"input":[[]],"output":{}},{"input":[[["a",1],["a",2],["a",0]]],"output":{"a":2}},{"input":[[["x",5]]],"output":{"x":5}},{"input":[[["p",1],["q",2],["p",3],["q",1]]],"output":{"p":3,"q":2}}],"constraints":"0 <= len(pairs) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of [name, score] pairs, return a dictionary mapping each name to the highest score recorded for that name.","reference_solution":"def solve(pairs):\n d = {}\n for name, score in pairs:\n if name not in d or score > d[name]:\n d[name] = score\n return d\n"}} {"submissionId":"cmsxa5bp600cgkup269swphi0","title":"Submission SWPHI0","payload":{"test_cases":[{"input":["Hello World"],"output":"hELLO wORLD"},{"input":[""],"output":""},{"input":["ALLCAPS"],"output":"allcaps"},{"input":["alllower"],"output":"ALLLOWER"},{"input":["MiXeD123"],"output":"mIxEd123"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return it with the case of every alphabetic character swapped.","reference_solution":"def solve(s):\n return s.swapcase()\n"}} {"submissionId":"cmsxa5bp600chkup23g40fk3v","title":"Submission 40FK3V","payload":{"test_cases":[{"input":["subdermatoglyphic"],"output":true},{"input":["hello"],"output":false},{"input":[""],"output":true},{"input":["Alphabet"],"output":false},{"input":["Six-Year-Old"],"output":true}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, determine whether it is an isogram (no letter repeats, case-insensitive, ignoring non-letters).","reference_solution":"def solve(s):\n letters = [c.lower() for c in s if c.isalpha()]\n return len(letters) == len(set(letters))\n"}} {"submissionId":"cmsxa5bp600cikup2wmjboody","title":"Submission JBOODY","payload":{"test_cases":[{"input":[["flower","flow","flight"]],"output":"fl"},{"input":[["dog","cat"]],"output":""},{"input":[[]],"output":""},{"input":[["same","same"]],"output":"same"},{"input":[["interspecies","interstellar","interstate"]],"output":"inters"}],"constraints":"0 <= len(words) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of strings, return their longest common prefix (or an empty string if there is none).","reference_solution":"def solve(words):\n if not words:\n return ''\n prefix = words[0]\n for w in words[1:]:\n while not w.startswith(prefix):\n prefix = prefix[:-1]\n if not prefix:\n return ''\n return prefix\n"}} {"submissionId":"cmsxa5bp600cjkup2bgtk158d","title":"Submission TK158D","payload":{"test_cases":[{"input":["aaabbc"],"output":"a3b2c1"},{"input":[""],"output":""},{"input":["a"],"output":"a1"},{"input":["abcd"],"output":"a1b1c1d1"},{"input":["aabbccddd"],"output":"a2b2c2d3"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return its run-length encoded form where each run of repeated characters becomes the character followed by its count.","reference_solution":"def solve(s):\n if not s:\n return ''\n result = []\n prev = s[0]\n count = 1\n for c in s[1:]:\n if c == prev:\n count += 1\n else:\n result.append(prev + str(count))\n prev = c\n count = 1\n result.append(prev + str(count))\n return ''.join(result)\n"}} {"submissionId":"cmsxa5bp600ckkup2acxhmm0a","title":"Submission XHMM0A","payload":{"test_cases":[{"input":["banana","an"],"output":2},{"input":["aaaa","aa"],"output":2},{"input":["","x"],"output":0},{"input":["hello","z"],"output":0},{"input":["abcabcabc","abc"],"output":3}],"constraints":"0 <= len(s), len(sub) <= 1000","time_limit_ms":500,"problem_statement":"Given a string and a substring, count how many non-overlapping times the substring occurs.","reference_solution":"def solve(s, sub):\n return s.count(sub)\n"}} {"submissionId":"cmsxa5bp600clkup29ew8vcuw","title":"Submission W8VCUW","payload":{"test_cases":[{"input":["programming"],"output":"progamin"},{"input":[""],"output":""},{"input":["aaaa"],"output":"a"},{"input":["abcabc"],"output":"abc"},{"input":["mississippi"],"output":"misp"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return a new string with duplicate characters removed, keeping only the first occurrence of each.","reference_solution":"def solve(s):\n seen = set()\n result = []\n for c in s:\n if c not in seen:\n seen.add(c)\n result.append(c)\n return ''.join(result)\n"}} {"submissionId":"cmsxa5bp600cmkup2lnkmy8c9","title":"Submission KMY8C9","payload":{"test_cases":[{"input":["hello",1,"?"],"output":"e"},{"input":["hello",10,"?"],"output":"?"},{"input":["",0,"x"],"output":"x"},{"input":["abc",-1,"y"],"output":"y"},{"input":["abc",2,"z"],"output":"c"}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, an index, and a default value, return the character at the index if valid, otherwise return the default.","reference_solution":"def solve(s, i, default):\n return s[i] if 0 <= i < len(s) else default\n"}} {"submissionId":"cmsxa5bp600cnkup2tjcmw5ke","title":"Submission CMW5KE","payload":{"test_cases":[{"input":["ace","abcde"],"output":true},{"input":["aec","abcde"],"output":false},{"input":["","abc"],"output":true},{"input":["abc",""],"output":false},{"input":["abc","abc"],"output":true}],"constraints":"0 <= len(s), len(t) <= 1000","time_limit_ms":500,"problem_statement":"Given two strings s and t, determine whether s is a subsequence of t (characters of s appear in t in the same order, not necessarily contiguous).","reference_solution":"def solve(s, t):\n it = iter(t)\n return all(c in it for c in s)\n"}} {"submissionId":"cmsxa5bp600cokup2bh1f1bmu","title":"Submission 1F1BMU","payload":{"test_cases":[{"input":["the quick brown fox"],"output":[3,5,5,3]},{"input":[""],"output":[]},{"input":["a bb ccc"],"output":[1,2,3]},{"input":["single"],"output":[6]},{"input":["one two three"],"output":[3,3,5]}],"constraints":"0 <= len(sentence) <= 1000","time_limit_ms":500,"problem_statement":"Given a sentence, return a list of the lengths of each word in order.","reference_solution":"def solve(sentence):\n return [len(w) for w in sentence.split()]\n"}} {"submissionId":"cmsxa5bp600cpkup279lyd1eb","title":"Submission LYD1EB","payload":{"test_cases":[{"input":["abc",3],"output":"def"},{"input":["Hello, World!",5],"output":"Mjqqt, Btwqi!"},{"input":["",10],"output":""},{"input":["xyz",3],"output":"abc"},{"input":["ABC",1],"output":"BCD"}],"constraints":"0 <= len(s) <= 1000, 0 <= shift <= 25","time_limit_ms":500,"problem_statement":"Given a string and an integer shift, encode the string using a Caesar cipher, shifting alphabetic characters by the given amount and preserving case, leaving non-letters unchanged.","reference_solution":"def solve(s, shift):\n result = []\n for c in s:\n if c.isalpha():\n base = ord('A') if c.isupper() else ord('a')\n result.append(chr((ord(c) - base + shift) % 26 + base))\n else:\n result.append(c)\n return ''.join(result)\n"}} {"submissionId":"cmsxa5bp600cqkup2qlpydsjs","title":"Submission PYDSJS","payload":{"test_cases":[{"input":[[1,2,3,4,5],2],"output":[[1,2],[3,4],[5]]},{"input":[[],3],"output":[]},{"input":[[1],5],"output":[[1]]},{"input":[[1,2,3,4,5,6],3],"output":[[1,2,3],[4,5,6]]},{"input":[[1,2,3],1],"output":[[1],[2],[3]]}],"constraints":"1 <= size <= 1000","time_limit_ms":500,"problem_statement":"Given a list and a chunk size, split it into a list of sublists of that size (the final sublist may be shorter).","reference_solution":"def solve(nums, size):\n return [nums[i:i+size] for i in range(0, len(nums), size)]\n"}} {"submissionId":"cmsxa5bp600crkup2b5axsnlt","title":"Submission AXSNLT","payload":{"test_cases":[{"input":[5],"output":[1,4,9,16,25]},{"input":[1],"output":[1]},{"input":[3],"output":[1,4,9]},{"input":[10],"output":[1,4,9,16,25,36,49,64,81,100]},{"input":[7],"output":[1,4,9,16,25,36,49]}],"constraints":"1 <= n <= 1000","time_limit_ms":500,"problem_statement":"Given a positive integer n, return a list of the squares of 1 through n.","reference_solution":"def solve(n):\n return [i*i for i in range(1, n+1)]\n"}} {"submissionId":"cmsxa5bp600cskup2zr2h7vwd","title":"Submission 2H7VWD","payload":{"test_cases":[{"input":[10],"output":[2,3,5,7]},{"input":[1],"output":[]},{"input":[2],"output":[2]},{"input":[20],"output":[2,3,5,7,11,13,17,19]},{"input":[30],"output":[2,3,5,7,11,13,17,19,23,29]}],"constraints":"1 <= n <= 10^4","time_limit_ms":500,"problem_statement":"Given a positive integer n, return a list of all prime numbers less than or equal to n.","reference_solution":"def solve(n):\n primes = []\n for i in range(2, n+1):\n is_p = True\n for j in range(2, int(i**0.5)+1):\n if i % j == 0:\n is_p = False\n break\n if is_p:\n primes.append(i)\n return primes\n"}} {"submissionId":"cmsxa5bp600ctkup2tb5n7zas","title":"Submission 5N7ZAS","payload":{"test_cases":[{"input":[3,5],"output":[3,6,9,12,15]},{"input":[1,3],"output":[1,2,3]},{"input":[7,1],"output":[7]},{"input":[0,4],"output":[0,0,0,0]},{"input":[5,10],"output":[5,10,15,20,25,30,35,40,45,50]}],"constraints":"1 <= size <= 1000","time_limit_ms":500,"problem_statement":"Given a number n and a size, return the first `size` multiples of n (n*1, n*2, ..., n*size).","reference_solution":"def solve(n, size):\n return [n * i for i in range(1, size+1)]\n"}} {"submissionId":"cmsxa5bp600cukup2az4njp0e","title":"Submission 4NJP0E","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":[3,5,7]},{"input":[[]],"output":[]},{"input":[[5]],"output":[]},{"input":[[1,1,1]],"output":[2,2]},{"input":[[-1,1,-1,1]],"output":[0,0,0]}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return a list of the sums of each pair of adjacent elements.","reference_solution":"def solve(nums):\n return [nums[i] + nums[i+1] for i in range(len(nums)-1)]\n"}} {"submissionId":"cmsxa5bp600cvkup2jsjj6iib","title":"Submission JJ6IIB","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":-2},{"input":[[]],"output":0},{"input":[[5]],"output":5},{"input":[[10,1,10,1]],"output":18},{"input":[[1,1,1]],"output":1}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return the alternating sum: first element minus second, plus third, minus fourth, and so on.","reference_solution":"def solve(nums):\n return sum(x if i % 2 == 0 else -x for i, x in enumerate(nums))\n"}} {"submissionId":"cmsxa5bp600cwkup2o3zfrzet","title":"Submission ZFRZET","payload":{"test_cases":[{"input":[[1,2,3,4],1],"output":[1,3,4]},{"input":[[5],0],"output":[]},{"input":[[1,2],1],"output":[1]},{"input":[[9,8,7],0],"output":[8,7]},{"input":[[1,2,3,4,5],4],"output":[1,2,3,4]}],"constraints":"0 <= idx < len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list and an index, return a new list with the element at that index removed.","reference_solution":"def solve(nums, idx):\n return nums[:idx] + nums[idx+1:]\n"}} {"submissionId":"cmsxa5bp600cxkup2eioslb35","title":"Submission OSLB35","payload":{"test_cases":[{"input":[[1,2,3],1,99],"output":[1,99,2,3]},{"input":[[],0,5],"output":[5]},{"input":[[1],1,2],"output":[1,2]},{"input":[[1,2,3],0,0],"output":[0,1,2,3]},{"input":[[1,2,3],3,4],"output":[1,2,3,4]}],"constraints":"0 <= idx <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list, an index, and a value, return a new list with the value inserted at that index.","reference_solution":"def solve(nums, idx, value):\n return nums[:idx] + [value] + nums[idx:]\n"}} {"submissionId":"cmsxa5bp600cykup25ijyorfl","title":"Submission JYORFL","payload":{"test_cases":[{"input":[[1,2,3],["a","b","c"]],"output":[[1,"a"],[2,"b"],[3,"c"]]},{"input":[[],[]],"output":[]},{"input":[[1],[9]],"output":[[1,9]]},{"input":[[1,2],[3,4]],"output":[[1,3],[2,4]]},{"input":[[5,6,7],[8,9,10]],"output":[[5,8],[6,9],[7,10]]}],"constraints":"0 <= len(a) == len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists of equal length, return a list of two-element lists pairing corresponding elements.","reference_solution":"def solve(a, b):\n return [list(pair) for pair in zip(a, b)]\n"}} {"submissionId":"cmsxa5bp600czkup27a73rjl8","title":"Submission 73RJL8","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":3},{"input":[[]],"output":0},{"input":[[5,5,5]],"output":1},{"input":[[1,2,3]],"output":3},{"input":[[1]],"output":1}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list, return the number of unique elements it contains.","reference_solution":"def solve(nums):\n return len(set(nums))\n"}} {"submissionId":"cmsxa5bp600d0kup2l3ssurkm","title":"Submission SSURKM","payload":{"test_cases":[{"input":[1],"output":true},{"input":[3],"output":true},{"input":[9],"output":true},{"input":[10],"output":false},{"input":[27],"output":true}],"constraints":"1 <= n <= 10^9","time_limit_ms":500,"problem_statement":"Given a positive integer, determine whether it is a power of three.","reference_solution":"def solve(n):\n if n < 1:\n return False\n while n % 3 == 0:\n n //= 3\n return n == 1\n"}} {"submissionId":"cmsxa5bp600d1kup2721e2spf","title":"Submission 1E2SPF","payload":{"test_cases":[{"input":[16],"output":7},{"input":[942],"output":6},{"input":[0],"output":0},{"input":[9],"output":9},{"input":[123456789],"output":9}],"constraints":"0 <= n <= 10^12","time_limit_ms":500,"problem_statement":"Given a non-negative integer, repeatedly sum its digits until a single digit remains, and return that digit.","reference_solution":"def solve(n):\n n = abs(n)\n while n >= 10:\n n = sum(int(d) for d in str(n))\n return n\n"}} {"submissionId":"cmsxa5bp600d2kup2tz88kxhj","title":"Submission 88KXHJ","payload":{"test_cases":[{"input":[19],"output":true},{"input":[2],"output":false},{"input":[1],"output":true},{"input":[7],"output":true},{"input":[4],"output":false}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer, determine whether it is a happy number (repeatedly replacing it with the sum of the squares of its digits eventually reaches 1).","reference_solution":"def solve(n):\n seen = set()\n while n != 1 and n not in seen:\n seen.add(n)\n n = sum(int(d)**2 for d in str(n))\n return n == 1\n"}} {"submissionId":"cmsxa5bp600d3kup27a164dgu","title":"Submission 164DGU","payload":{"test_cases":[{"input":[1],"output":1},{"input":[2],"output":5},{"input":[5],"output":35},{"input":[10],"output":145},{"input":[100],"output":14950}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer n, return the nth pentagonal number, using the formula n*(3n-1)/2.","reference_solution":"def solve(n):\n return n * (3 * n - 1) // 2\n"}} {"submissionId":"cmsxa5bp600d5kup24feiye9b","title":"Submission EIYE9B","payload":{"test_cases":[{"input":[10,3],"output":18},{"input":[20,5],"output":30},{"input":[1,1],"output":0},{"input":[100,10],"output":450},{"input":[15,4],"output":24}],"constraints":"1 <= m <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given an upper bound n and a divisor m, return the sum of all positive multiples of m that are strictly less than n.","reference_solution":"def solve(n, m):\n return sum(i for i in range(1, n) if i % m == 0)\n"}} {"submissionId":"cmsxa5bp600d6kup2v6lefzf5","title":"Submission LEFZF5","payload":{"test_cases":[{"input":[1],"output":0},{"input":[6],"output":8},{"input":[27],"output":111},{"input":[7],"output":16},{"input":[16],"output":4}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer, return the number of steps required to reach 1 using the Collatz conjecture rule (halve if even, else 3n+1).","reference_solution":"def solve(n):\n steps = 0\n while n != 1:\n if n % 2 == 0:\n n //= 2\n else:\n n = 3 * n + 1\n steps += 1\n return steps\n"}} {"submissionId":"cmsxa5bp600d7kup2jfbbb77m","title":"Submission BBB77M","payload":{"test_cases":[{"input":[255,16],"output":"FF"},{"input":[10,2],"output":"1010"},{"input":[0,8],"output":"0"},{"input":[100,8],"output":"144"},{"input":[31,16],"output":"1F"}],"constraints":"0 <= n <= 10^9, 2 <= base <= 16","time_limit_ms":500,"problem_statement":"Given a non-negative integer n and a base between 2 and 16, convert n to that base and return it as a string using digits 0-9 and uppercase letters A-F.","reference_solution":"def solve(n, base):\n if n == 0:\n return '0'\n digits = '0123456789ABCDEF'\n result = ''\n while n > 0:\n result = digits[n % base] + result\n n //= base\n return result\n"}} {"submissionId":"cmsxa5bp600d8kup21ja2kro5","title":"Submission A2KRO5","payload":{"test_cases":[{"input":[5,2],"output":10},{"input":[10,0],"output":1},{"input":[10,10],"output":1},{"input":[6,3],"output":20},{"input":[20,5],"output":15504}],"constraints":"0 <= r <= n <= 30","time_limit_ms":500,"problem_statement":"Given non-negative integers n and r (r <= n), return the number of ways to choose r items from n (n choose r).","reference_solution":"def solve(n, r):\n from math import factorial\n return factorial(n) // (factorial(r) * factorial(n - r))\n"}} {"submissionId":"cmsxa5bp600d9kup234sdpztg","title":"Submission SDPZTG","payload":{"test_cases":[{"input":[12],"output":true},{"input":[6],"output":false},{"input":[28],"output":false},{"input":[1],"output":false},{"input":[24],"output":true}],"constraints":"1 <= n <= 10^5","time_limit_ms":500,"problem_statement":"Given a positive integer, determine whether it is an abundant number (the sum of its proper divisors exceeds the number itself).","reference_solution":"def solve(n):\n return sum(i for i in range(1, n) if n % i == 0) > n\n"}} {"submissionId":"cmsxa5bp600dakup20vvymzkb","title":"Submission VYMZKB","payload":{"test_cases":[{"input":[[3,1,5]],"output":9},{"input":[[]],"output":0},{"input":[[0]],"output":0},{"input":[[10,-5,2]],"output":32},{"input":[[1,2,3,4]],"output":4}],"constraints":"0 <= len(requests) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of requested floors and a starting floor of 0, return the total distance traveled visiting each requested floor in order.","reference_solution":"def solve(requests):\n total = 0\n current = 0\n for floor in requests:\n total += abs(floor - current)\n current = floor\n return total\n"}} {"submissionId":"cmsxa5bp600dbkup2io1037so","title":"Submission 1037SO","payload":{"test_cases":[{"input":["red"],"output":"green"},{"input":["green"],"output":"yellow"},{"input":["yellow"],"output":"red"},{"input":["red"],"output":"green"},{"input":["green"],"output":"yellow"}],"constraints":"state is one of 'red', 'green', 'yellow'","time_limit_ms":500,"problem_statement":"Given the current state of a traffic light ('red', 'green', or 'yellow'), return its next state in the cycle red -> green -> yellow -> red.","reference_solution":"def solve(state):\n order = {'red': 'green', 'green': 'yellow', 'yellow': 'red'}\n return order[state]\n"}} {"submissionId":"cmsxa5bp600dckup2i926q2ny","title":"Submission 26Q2NY","payload":{"test_cases":[{"input":[10,7],"output":3},{"input":[5,5],"output":0},{"input":[100,1],"output":99},{"input":[20,15],"output":5},{"input":[1,0],"output":1}],"constraints":"0 <= price <= paid <= 10^6","time_limit_ms":500,"problem_statement":"Given the amount paid and the price of an item, return the change owed.","reference_solution":"def solve(paid, price):\n return paid - price\n"}} {"submissionId":"cmsxa5bp600ddkup27jzxtzc9","title":"Submission ZXTZC9","payload":{"test_cases":[{"input":["abc"],"output":"Weak"},{"input":["abcdefgh"],"output":"Medium"},{"input":["Abcdefg1"],"output":"Strong"},{"input":["password"],"output":"Medium"},{"input":["P4ssword"],"output":"Strong"}],"constraints":"0 <= len(password) <= 100","time_limit_ms":500,"problem_statement":"Given a password, rate its strength as 'Weak', 'Medium', or 'Strong' based on length (>=8) and the presence of digits, uppercase, and lowercase letters (score of matched criteria: 0-1 is Weak, 2-3 is Medium, 4 is Strong).","reference_solution":"def solve(password):\n length_ok = len(password) >= 8\n has_digit = any(c.isdigit() for c in password)\n has_upper = any(c.isupper() for c in password)\n has_lower = any(c.islower() for c in password)\n score = sum([length_ok, has_digit, has_upper, has_lower])\n if score <= 1:\n return 'Weak'\n elif score in (2, 3):\n return 'Medium'\n return 'Strong'\n"}} {"submissionId":"cmsxa5bp600dekup28x93uoip","title":"Submission 93UOIP","payload":{"test_cases":[{"input":[100,30],"output":4},{"input":[50,50],"output":1},{"input":[1,1],"output":1},{"input":[99,10],"output":10},{"input":[7,2],"output":4}],"constraints":"1 <= rate <= capacity <= 10^6","time_limit_ms":500,"problem_statement":"Given a tank capacity and a fill rate per minute, return the number of whole minutes needed to fill the tank completely (round up).","reference_solution":"def solve(capacity, rate):\n import math\n return math.ceil(capacity / rate)\n"}} {"submissionId":"cmsxa5bp600dfkup2dhsiir9d","title":"Submission SIIR9D","payload":{"test_cases":[{"input":[[10,20],[1,2]],"output":50},{"input":[[],[]],"output":0},{"input":[[5],[3]],"output":15},{"input":[[1,1,1],[1,1,1]],"output":3},{"input":[[100,50],[0,2]],"output":100}],"constraints":"0 <= len(prices) == len(quantities) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of item prices and a list of quantities, return the total cost of the cart.","reference_solution":"def solve(prices, quantities):\n return sum(p * q for p, q in zip(prices, quantities))\n"}} {"submissionId":"cmsxa5bp600dgkup2m9vomkp4","title":"Submission VOMKP4","payload":{"test_cases":[{"input":[100,10],"output":90},{"input":[50,0],"output":50},{"input":[200,50],"output":100},{"input":[99.99,25],"output":74.99},{"input":[10,100],"output":0}],"constraints":"0 <= price <= 10^6, 0 <= discount_pct <= 100","time_limit_ms":500,"problem_statement":"Given a price and a discount percentage, return the discounted price rounded to 2 decimal places.","reference_solution":"def solve(price, discount_pct):\n return round(price * (1 - discount_pct/100), 2)\n"}} {"submissionId":"cmsxa5bp600dhkup22oj0nsor","title":"Submission J0NSOR","payload":{"test_cases":[{"input":[100,10],"output":110},{"input":[50,0],"output":50},{"input":[200,5],"output":210},{"input":[99.99,8],"output":107.99},{"input":[10,20],"output":12}],"constraints":"0 <= price <= 10^6, 0 <= tax_pct <= 100","time_limit_ms":500,"problem_statement":"Given a price and a tax percentage, return the total price including tax, rounded to 2 decimal places.","reference_solution":"def solve(price, tax_pct):\n return round(price * (1 + tax_pct/100), 2)\n"}} {"submissionId":"cmsxa5bp700dikup22jatlkr0","title":"Submission ATLKR0","payload":{"test_cases":[{"input":[10,3,5],"output":20},{"input":[9,3,5],"output":15},{"input":[1,1,10],"output":10},{"input":[100,25,2],"output":8},{"input":[7,10,4],"output":4}],"constraints":"1 <= batch_size <= items <= 10^6","time_limit_ms":500,"problem_statement":"Given a number of items, a batch size, and the time per batch, return the total time needed to process all items in full batches (partial batches still take the full batch time).","reference_solution":"def solve(items, batch_size, time_per_batch):\n import math\n return math.ceil(items / batch_size) * time_per_batch\n"}} {"submissionId":"cmsxa5bp700djkup2wdsckcxu","title":"Submission SCKCXU","payload":{"test_cases":[{"input":[[10,-5,-20,15]],"output":15},{"input":[[]],"output":0},{"input":[[5,5,5]],"output":15},{"input":[[-10,20]],"output":20},{"input":[[100,-200,50]],"output":50}],"constraints":"0 <= len(events) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of point events (positive for gains, negative for penalties), return the running total score after all events, never letting the total drop below zero.","reference_solution":"def solve(events):\n total = 0\n for e in events:\n total = max(0, total + e)\n return total\n"}} {"submissionId":"cmsxa5bp700dkkup2vnnz80or","title":"Submission NZ80OR","payload":{"test_cases":[{"input":["user@example.com"],"output":true},{"input":["bad-email"],"output":false},{"input":["a@b"],"output":false},{"input":["@missing.com"],"output":false},{"input":["two@@at.com"],"output":false}],"constraints":"0 <= len(email) <= 200","time_limit_ms":500,"problem_statement":"Given a string, perform a simplified email validity check: exactly one '@' symbol, a non-empty part before it, and a '.' in the domain part that isn't at the very start.","reference_solution":"def solve(email):\n if email.count('@') != 1:\n return False\n local, domain = email.split('@')\n return len(local) > 0 and '.' in domain and not domain.startswith('.')\n"}} {"submissionId":"cmsxa5bp700dlkup2j7vbw400","title":"Submission VBW400","payload":{"test_cases":[{"input":["abc"],"output":false},{"input":["abcdefgh"],"output":false},{"input":["abcdefg1"],"output":true},{"input":["12345678"],"output":false},{"input":["Password1"],"output":true}],"constraints":"0 <= len(password) <= 100","time_limit_ms":500,"problem_statement":"Given a password, return True if it is at least 8 characters long and contains at least one digit and one letter, otherwise False.","reference_solution":"def solve(password):\n has_digit = any(c.isdigit() for c in password)\n has_letter = any(c.isalpha() for c in password)\n return len(password) >= 8 and has_digit and has_letter\n"}} {"submissionId":"cmsxa5bp700dmkup2tns12hiw","title":"Submission S12HIW","payload":{"test_cases":[{"input":["192.168.1.1"],"output":true},{"input":["256.1.1.1"],"output":false},{"input":["1.2.3"],"output":false},{"input":["a.b.c.d"],"output":false},{"input":["0.0.0.0"],"output":true}],"constraints":"0 <= len(ip) <= 100","time_limit_ms":500,"problem_statement":"Given a string, determine whether it is a syntactically valid IPv4 address (four dot-separated numbers, each between 0 and 255).","reference_solution":"def solve(ip):\n parts = ip.split('.')\n if len(parts) != 4:\n return False\n for p in parts:\n if not p.isdigit():\n return False\n if not 0 <= int(p) <= 255:\n return False\n return True\n"}} {"submissionId":"cmsxa5bp700dnkup2fz3c7bdd","title":"Submission 3C7BDD","payload":{"test_cases":[{"input":["A man a plan a canal Panama"],"output":true},{"input":["Hello"],"output":false},{"input":[""],"output":true},{"input":["Was it a car or a cat I saw"],"output":true},{"input":["No lemon no melon"],"output":true}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, determine whether it is a palindrome after removing non-alphanumeric characters and ignoring case.","reference_solution":"def solve(s):\n cleaned = ''.join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n"}} {"submissionId":"cmsxa5bp700dokup2r69dqa8e","title":"Submission 9DQA8E","payload":{"test_cases":[{"input":[[[1,2,3],[1,1,2]],0],"output":true},{"input":[[[1,2,3],[1,1,2]],1],"output":false},{"input":[[[5]],0],"output":true},{"input":[[[1,1],[2,2]],0],"output":false},{"input":[[[9,8,7]],0],"output":true}],"constraints":"0 <= row_idx < rows <= 100","time_limit_ms":500,"problem_statement":"Given a matrix and a row index, determine whether all elements in that row are unique.","reference_solution":"def solve(matrix, row_idx):\n row = matrix[row_idx]\n return len(row) == len(set(row))\n"}} {"submissionId":"cmsxa5bp700dpkup2231qagm6","title":"Submission 1QAGM6","payload":{"test_cases":[{"input":[[1,2],[1,2,3]],"output":true},{"input":[[1,4],[1,2,3]],"output":false},{"input":[[],[1,2]],"output":true},{"input":[[1,2,3],[1,2,3]],"output":true},{"input":[[5],[]],"output":false}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists, determine whether every element of the first appears in the second (treated as sets).","reference_solution":"def solve(a, b):\n return set(a).issubset(set(b))\n"}} {"submissionId":"cmsxa5bp700dqkup22vug8ane","title":"Submission UG8ANE","payload":{"test_cases":[{"input":[[1,2],[3,4]],"output":true},{"input":[[1,2],[2,3]],"output":false},{"input":[[],[1,2]],"output":true},{"input":[[1,2,3],[1,2,3]],"output":false},{"input":[[5],[6]],"output":true}],"constraints":"0 <= len(a), len(b) <= 1000","time_limit_ms":500,"problem_statement":"Given two lists, determine whether they share no common elements.","reference_solution":"def solve(a, b):\n return set(a).isdisjoint(set(b))\n"}} {"submissionId":"cmsxa5bp700drkup2as7psv41","title":"Submission 7PSV41","payload":{"test_cases":[{"input":[[5,5,5]],"output":true},{"input":[[1,2]],"output":false},{"input":[[7]],"output":true},{"input":[[0,0,0,1]],"output":false},{"input":[[9,9]],"output":true}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list, determine whether all elements are identical.","reference_solution":"def solve(nums):\n return len(set(nums)) == 1\n"}} {"submissionId":"cmsxa5bp700dskup2dkdts6hp","title":"Submission DTS6HP","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":true},{"input":[[1,2,4]],"output":false},{"input":[[]],"output":true},{"input":[[5]],"output":true},{"input":[[3,4,5,7]],"output":false}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, determine whether each element is exactly one more than the previous element.","reference_solution":"def solve(nums):\n return all(nums[i+1] - nums[i] == 1 for i in range(len(nums)-1))\n"}} {"submissionId":"cmsxa84x400dtkup2s53kj0vk","title":"Submission 3KJ0VK","payload":{"test_cases":[{"input":["(()"],"output":false},{"input":["()()"],"output":true},{"input":[")("],"output":true},{"input":[""],"output":true},{"input":["((()))"],"output":true}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string containing '(' and ')' characters (and possibly others), determine whether the total counts of each bracket type are equal (ignoring nesting order).","reference_solution":"def solve(s):\n return s.count('(') == s.count(')')\n"}} {"submissionId":"cmsxa84x400dvkup2q0beismp","title":"Submission BEISMP","payload":{"test_cases":[{"input":[[1,5,3]],"output":5},{"input":[[7]],"output":7},{"input":[[-1,-5,-3]],"output":-1},{"input":[[2,2,2]],"output":2},{"input":[[10,20,5]],"output":20}],"constraints":"1 <= len(nums) <= 500","time_limit_ms":500,"problem_statement":"Using recursion, find the maximum value in a non-empty list.","reference_solution":"def solve(nums):\n if len(nums) == 1:\n return nums[0]\n rest_max = solve(nums[1:])\n return nums[0] if nums[0] > rest_max else rest_max\n"}} {"submissionId":"cmsxa84x400dwkup2mv7bzit2","title":"Submission 7BZIT2","payload":{"test_cases":[{"input":[[1,2,1,3,1],1],"output":3},{"input":[[],5],"output":0},{"input":[[5],5],"output":1},{"input":[[1,2,3],4],"output":0},{"input":[[2,2,2],2],"output":3}],"constraints":"0 <= len(nums) <= 500","time_limit_ms":500,"problem_statement":"Using recursion, count how many times a target value appears in a list.","reference_solution":"def solve(nums, target):\n if not nums:\n return 0\n return (1 if nums[0] == target else 0) + solve(nums[1:], target)\n"}} {"submissionId":"cmsxa84x400dxkup2zmq9guze","title":"Submission Q9GUZE","payload":{"test_cases":[{"input":[[1,[2,3],[4,[5,6]]]],"output":[1,2,3,4,5,6]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[1,2,3]},{"input":[[[1,[2,[3,[4]]]]]],"output":[1,2,3,4]},{"input":[[[],[1],[2,[3]]]],"output":[1,2,3]}],"constraints":"0 <= total elements <= 500","time_limit_ms":500,"problem_statement":"Using recursion, flatten a list that may contain nested lists to any depth into a single flat list.","reference_solution":"def solve(nested):\n result = []\n for item in nested:\n if isinstance(item, list):\n result.extend(solve(item))\n else:\n result.append(item)\n return result\n"}} {"submissionId":"cmsxa84x400dykup22160h4mk","title":"Submission 60H4MK","payload":{"test_cases":[{"input":[[1,2,3]],"output":true},{"input":[[3,2,1]],"output":false},{"input":[[]],"output":true},{"input":[[5]],"output":true},{"input":[[1,1,2]],"output":true}],"constraints":"0 <= len(nums) <= 500","time_limit_ms":500,"problem_statement":"Using recursion, determine whether a list is sorted in non-decreasing order.","reference_solution":"def solve(nums):\n if len(nums) <= 1:\n return True\n if nums[0] > nums[1]:\n return False\n return solve(nums[1:])\n"}} {"submissionId":"cmsxa84x400dzkup2do4h74j5","title":"Submission 4H74J5","payload":{"test_cases":[{"input":[0],"output":1},{"input":[1],"output":2},{"input":[5],"output":32},{"input":[10],"output":1024},{"input":[3],"output":8}],"constraints":"0 <= n <= 30","time_limit_ms":500,"problem_statement":"Using recursion, compute the number of subsets (the power set size) of a set with n elements, which is 2^n.","reference_solution":"def solve(n):\n if n == 0:\n return 1\n return 2 * solve(n - 1)\n"}} {"submissionId":"cmsxa84x400e1kup22x8s18yp","title":"Submission 8S18YP","payload":{"test_cases":[{"input":[0],"output":"0"},{"input":[1],"output":"1"},{"input":[10],"output":"1010"},{"input":[255],"output":"11111111"},{"input":[1024],"output":"10000000000"}],"constraints":"0 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Using recursion, convert a non-negative integer to its binary string representation.","reference_solution":"def solve(n):\n if n == 0:\n return '0'\n def helper(x):\n if x == 0:\n return ''\n return helper(x // 2) + str(x % 2)\n return helper(n)\n"}} {"submissionId":"cmsxa84x400e2kup2lbiayfbe","title":"Submission IAYFBE","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":24},{"input":[[]],"output":1},{"input":[[5]],"output":5},{"input":[[2,2,2]],"output":8},{"input":[[-1,2,-3]],"output":6}],"constraints":"0 <= len(nums) <= 500","time_limit_ms":500,"problem_statement":"Using recursion, compute the product of all elements in a list (return 1 for an empty list).","reference_solution":"def solve(nums):\n if not nums:\n return 1\n return nums[0] * solve(nums[1:])\n"}} {"submissionId":"cmsxa84x400e3kup26vtc98zs","title":"Submission TC98ZS","payload":{"test_cases":[{"input":["123"],"output":123},{"input":["7"],"output":7},{"input":["1000"],"output":1000},{"input":["999"],"output":999},{"input":["42"],"output":42}],"constraints":"1 <= len(s) <= 15, s contains only digits","time_limit_ms":500,"problem_statement":"Using recursion, parse a non-empty string of digits into its integer value.","reference_solution":"def solve(s):\n if len(s) == 1:\n return int(s)\n return solve(s[:-1]) * 10 + int(s[-1])\n"}} {"submissionId":"cmsxa84x400e4kup28ir7wlxa","title":"Submission R7WLXA","payload":{"test_cases":[{"input":[1],"output":[[1]]},{"input":[2],"output":[[1,0],[0,1]]},{"input":[3],"output":[[1,0,0],[0,1,0],[0,0,1]]},{"input":[4],"output":[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]},{"input":[5],"output":[[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1]]}],"constraints":"1 <= n <= 50","time_limit_ms":500,"problem_statement":"Given a positive integer n, return the n x n identity matrix.","reference_solution":"def solve(n):\n return [[1 if i == j else 0 for j in range(n)] for i in range(n)]\n"}} {"submissionId":"cmsxa84x400e5kup2mtxv3ys7","title":"Submission XV3YS7","payload":{"test_cases":[{"input":[[[1,2],[3,4]],[[5,6],[7,8]]],"output":[[6,8],[10,12]]},{"input":[[[0]],[[0]]],"output":[[0]]},{"input":[[[1]],[[1]]],"output":[[2]]},{"input":[[[1,1],[1,1]],[[2,2],[2,2]]],"output":[[3,3],[3,3]]},{"input":[[[-1,-1]],[[1,1]]],"output":[[0,0]]}],"constraints":"1 <= rows, cols <= 50","time_limit_ms":500,"problem_statement":"Given two matrices of the same dimensions, return their element-wise sum.","reference_solution":"def solve(a, b):\n return [[a[i][j] + b[i][j] for j in range(len(a[0]))] for i in range(len(a))]\n"}} {"submissionId":"cmsxa84x400e6kup2ehrqbzhf","title":"Submission RQBZHF","payload":{"test_cases":[{"input":[[[1,2],[3,4]],2],"output":[[2,4],[6,8]]},{"input":[[[0]],5],"output":[[0]]},{"input":[[[1]],0],"output":[[0]]},{"input":[[[1,-1]],3],"output":[[3,-3]]},{"input":[[[5,5],[5,5]],-1],"output":[[-5,-5],[-5,-5]]}],"constraints":"1 <= rows, cols <= 50","time_limit_ms":500,"problem_statement":"Given a matrix and a scalar k, return the matrix with every element multiplied by k.","reference_solution":"def solve(matrix, k):\n return [[x * k for x in row] for row in matrix]\n"}} {"submissionId":"cmsxa84x400e7kup2ox72v445","title":"Submission 72V445","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":5},{"input":[[[5]]],"output":5},{"input":[[[1,0,0],[0,1,0],[0,0,1]]],"output":1},{"input":[[[1,2,3],[4,5,6],[7,8,9]]],"output":15},{"input":[[[0,0],[0,0]]],"output":0}],"constraints":"1 <= n <= 50","time_limit_ms":500,"problem_statement":"Given a square matrix, return the sum of the elements on its anti-diagonal (top-right to bottom-left).","reference_solution":"def solve(matrix):\n n = len(matrix)\n return sum(matrix[i][n-1-i] for i in range(n))\n"}} {"submissionId":"cmsxa84x400e8kup2w3473idv","title":"Submission 473IDV","payload":{"test_cases":[{"input":[[[1,2],[10,10],[3,3]]],"output":1},{"input":[[[5]]],"output":0},{"input":[[[1,1],[1,1]]],"output":0},{"input":[[[-1,-1],[0,0]]],"output":1},{"input":[[[9],[1],[5]]],"output":0}],"constraints":"1 <= rows, cols <= 50","time_limit_ms":500,"problem_statement":"Given a matrix, return the index of the row with the largest sum (first such row if there is a tie).","reference_solution":"def solve(matrix):\n sums = [sum(row) for row in matrix]\n return sums.index(max(sums))\n"}} {"submissionId":"cmsxa84x400e9kup2r17hfzfr","title":"Submission 7HFZFR","payload":{"test_cases":[{"input":[[[1,2,3],[3,2,1]],0],"output":true},{"input":[[[1,2,3],[3,2,1]],1],"output":false},{"input":[[[5]],0],"output":true},{"input":[[[1,1,1]],0],"output":true},{"input":[[[2,1]],0],"output":false}],"constraints":"0 <= row_idx < rows <= 50","time_limit_ms":500,"problem_statement":"Given a matrix and a row index, determine whether that row is sorted in non-decreasing order.","reference_solution":"def solve(matrix, row_idx):\n row = matrix[row_idx]\n return row == sorted(row)\n"}} {"submissionId":"cmsxa84x400eakup2l01r64wz","title":"Submission 1R64WZ","payload":{"test_cases":[{"input":[[[1,2,3],[4,5,6],[7,8,9]]],"output":40},{"input":[[[5]]],"output":5},{"input":[[[1,2],[3,4]]],"output":10},{"input":[[[1,1,1,1]]],"output":4},{"input":[[[1],[2],[3]]],"output":6}],"constraints":"1 <= rows, cols <= 50","time_limit_ms":500,"problem_statement":"Given a matrix, return the sum of all elements on its border (first/last row and first/last column).","reference_solution":"def solve(matrix):\n rows = len(matrix)\n cols = len(matrix[0])\n total = 0\n for i in range(rows):\n for j in range(cols):\n if i == 0 or i == rows-1 or j == 0 or j == cols-1:\n total += matrix[i][j]\n return total\n"}} {"submissionId":"cmsxa84x400ebkup2ejhgvpol","title":"Submission HGVPOL","payload":{"test_cases":[{"input":[[[1,2],[2,1]],2,9],"output":[[1,9],[9,1]]},{"input":[[[0,0]],0,1],"output":[[1,1]]},{"input":[[[5]],5,0],"output":[[0]]},{"input":[[[1,1],[1,1]],1,2],"output":[[2,2],[2,2]]},{"input":[[[3,4],[5,6]],10,0],"output":[[3,4],[5,6]]}],"constraints":"1 <= rows, cols <= 50","time_limit_ms":500,"problem_statement":"Given a matrix and two values, return the matrix with every occurrence of the first value replaced by the second.","reference_solution":"def solve(matrix, old, new):\n return [[new if x == old else x for x in row] for row in matrix]\n"}} {"submissionId":"cmsxa84x400eckup2t865y3v9","title":"Submission 65Y3V9","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":"1,2,3,4"},{"input":[[[5]]],"output":"5"},{"input":[[[1,2,3]]],"output":"1,2,3"},{"input":[[[1],[2],[3]]],"output":"1,2,3"},{"input":[[[9,8],[7,6]]],"output":"9,8,7,6"}],"constraints":"1 <= rows, cols <= 50","time_limit_ms":500,"problem_statement":"Given a matrix, flatten it in row-major order and return the elements joined into a comma-separated string.","reference_solution":"def solve(matrix):\n flat = [str(x) for row in matrix for x in row]\n return ','.join(flat)\n"}} {"submissionId":"cmsxa84x400edkup21r8r8v6r","title":"Submission 8R8V6R","payload":{"test_cases":[{"input":[[[1,2],[-1,3]]],"output":1},{"input":[[[1,1],[1,1]]],"output":2},{"input":[[[0,1]]],"output":0},{"input":[[[5],[6],[-1]]],"output":2},{"input":[[[2,2],[3,3],[4,4]]],"output":3}],"constraints":"1 <= rows, cols <= 50","time_limit_ms":500,"problem_statement":"Given a matrix, count how many rows contain only strictly positive elements.","reference_solution":"def solve(matrix):\n return sum(1 for row in matrix if all(x > 0 for x in row))\n"}} {"submissionId":"cmsxa84x400eekup2eyprjerq","title":"Submission PRJERQ","payload":{"test_cases":[{"input":["aab"],"output":{"a":2,"b":1}},{"input":[""],"output":{}},{"input":["x"],"output":{"x":1}},{"input":["hello"],"output":{"e":1,"h":1,"l":2,"o":1}},{"input":["mississippi"],"output":{"i":4,"m":1,"p":2,"s":4}}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return a dictionary mapping each character to how many times it occurs.","reference_solution":"def solve(s):\n freq = {}\n for c in s:\n freq[c] = freq.get(c, 0) + 1\n return freq\n"}} {"submissionId":"cmsxa84x400efkup2bmrvotri","title":"Submission RVOTRI","payload":{"test_cases":[{"input":[{"a":1,"b":5,"c":10},4],"output":["b","c"]},{"input":[{},0],"output":[]},{"input":[{"x":1},5],"output":[]},{"input":[{"p":10,"q":20},0],"output":["p","q"]},{"input":[{"m":-1,"n":1},-5],"output":["m","n"]}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary of numbers and a threshold, return a sorted list of keys whose value is strictly greater than the threshold.","reference_solution":"def solve(d, threshold):\n return sorted(k for k, v in d.items() if v > threshold)\n"}} {"submissionId":"cmsxa84x400egkup28vkgms50","title":"Submission KGMS50","payload":{"test_cases":[{"input":[{"a":1,"b":2}],"output":3},{"input":[{}],"output":0},{"input":[{"x":10}],"output":10},{"input":[{"p":-1,"q":1}],"output":0},{"input":[{"m":5,"n":5,"o":5}],"output":15}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary of numbers, return the sum of all its values.","reference_solution":"def solve(d):\n return sum(d.values())\n"}} {"submissionId":"cmsxa84x400ehkup2wwuv94ec","title":"Submission UV94EC","payload":{"test_cases":[{"input":[{"a":1,"b":2}],"output":1.5},{"input":[{"x":10}],"output":10},{"input":[{"p":1,"q":2,"r":3}],"output":2},{"input":[{"m":-1,"n":1}],"output":0},{"input":[{"a":5,"b":5}],"output":5}],"constraints":"1 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty dictionary of numbers, return the average of its values rounded to 2 decimal places.","reference_solution":"def solve(d):\n return round(sum(d.values())/len(d), 2)\n"}} {"submissionId":"cmsxa84x400eikup2v0mfwdof","title":"Submission MFWDOF","payload":{"test_cases":[{"input":[{"a":3,"b":1,"c":2}],"output":["b","c","a"]},{"input":[{}],"output":[]},{"input":[{"x":1}],"output":["x"]},{"input":[{"p":5,"q":5}],"output":["p","q"]},{"input":[{"m":-1,"n":-5}],"output":["n","m"]}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary of numbers, return a list of its keys sorted by their values in ascending order.","reference_solution":"def solve(d):\n return sorted(d, key=d.get)\n"}} {"submissionId":"cmsxa84x400ejkup2diq4sqa0","title":"Submission Q4SQA0","payload":{"test_cases":[{"input":[{"a":1,"b":5,"c":10},2,8],"output":{"b":5}},{"input":[{},0,10],"output":{}},{"input":[{"x":1},0,0],"output":{}},{"input":[{"p":10,"q":20},15,25],"output":{"q":20}},{"input":[{"m":-1,"n":1},-1,1],"output":{"m":-1,"n":1}}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary of numbers and a low/high bound, return a new dictionary containing only entries whose value falls within the inclusive range.","reference_solution":"def solve(d, low, high):\n return {k: v for k, v in d.items() if low <= v <= high}\n"}} {"submissionId":"cmsxa84x400ekkup25negab42","title":"Submission EGAB42","payload":{"test_cases":[{"input":[["a","b"],[1,2]],"output":{"a":1,"b":2}},{"input":[[],[]],"output":{}},{"input":[["x"],[10]],"output":{"x":10}},{"input":[["p","q","r"],[1,2,3]],"output":{"p":1,"q":2,"r":3}},{"input":[["m"],[0]],"output":{"m":0}}],"constraints":"0 <= len(keys) == len(values) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of keys and a list of values of equal length, build and return a dictionary pairing them.","reference_solution":"def solve(keys, values):\n return dict(zip(keys, values))\n"}} {"submissionId":"cmsxa84x400elkup2sccj8kzx","title":"Submission CJ8KZX","payload":{"test_cases":[{"input":[{"a":1,"b":2},2],"output":true},{"input":[{},1],"output":false},{"input":[{"x":10},5],"output":false},{"input":[{"p":1,"q":2},1],"output":true},{"input":[{"m":0},0],"output":true}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary and a value, determine whether the value appears among the dictionary's values.","reference_solution":"def solve(d, value):\n return value in d.values()\n"}} {"submissionId":"cmsxa84x400emkup2w4glcuz5","title":"Submission GLCUZ5","payload":{"test_cases":[{"input":[{"a":1,"b":2,"c":1},1],"output":{"b":2}},{"input":[{},0],"output":{}},{"input":[{"x":5},5],"output":{}},{"input":[{"p":1,"q":2},3],"output":{"p":1,"q":2}},{"input":[{"m":0,"n":0},0],"output":{}}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary and a target value, return a new dictionary with all entries having that value removed.","reference_solution":"def solve(d, value):\n return {k: v for k, v in d.items() if v != value}\n"}} {"submissionId":"cmsxa84x400enkup2dwgx4ggq","title":"Submission GX4GGQ","payload":{"test_cases":[{"input":[{"a":1,"b":1,"c":2}],"output":2},{"input":[{}],"output":0},{"input":[{"x":5}],"output":1},{"input":[{"p":1,"q":2,"r":3}],"output":3},{"input":[{"m":0,"n":0,"o":0}],"output":1}],"constraints":"0 <= len(d) <= 1000","time_limit_ms":500,"problem_statement":"Given a dictionary, return the number of distinct values it contains.","reference_solution":"def solve(d):\n return len(set(d.values()))\n"}} {"submissionId":"cmsxa84x400eokup2qpebp5fw","title":"Submission EBP5FW","payload":{"test_cases":[{"input":[[7,1,5,3,6,4]],"output":5},{"input":[[7,6,4,3,1]],"output":0},{"input":[[]],"output":0},{"input":[[5]],"output":0},{"input":[[1,2,3,4,5]],"output":4}],"constraints":"0 <= len(temps) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of daily temperature readings, find the maximum value of (a later day's reading minus an earlier day's reading); return 0 if no such positive gain is possible.","reference_solution":"def solve(temps):\n if not temps:\n return 0\n min_so_far = temps[0]\n best = 0\n for t in temps[1:]:\n if t - min_so_far > best:\n best = t - min_so_far\n if t < min_so_far:\n min_so_far = t\n return best\n"}} {"submissionId":"cmsxa84x500epkup27ynex27s","title":"Submission NEX27S","payload":{"test_cases":[{"input":[[1,1,2,2,2,3]],"output":3},{"input":[[]],"output":0},{"input":[[5]],"output":1},{"input":[[1,2,3]],"output":1},{"input":[[4,4,4,4]],"output":4}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list, return the length of the longest run of consecutive equal elements.","reference_solution":"def solve(nums):\n if not nums:\n return 0\n longest = 1\n current = 1\n for i in range(1, len(nums)):\n if nums[i] == nums[i-1]:\n current += 1\n longest = max(longest, current)\n else:\n current = 1\n return longest\n"}} {"submissionId":"cmsxa84x500eqkup2xh6ojmcs","title":"Submission 6OJMCS","payload":{"test_cases":[{"input":[1],"output":0},{"input":[10],"output":4},{"input":[1024],"output":10},{"input":[5],"output":3},{"input":[1000000],"output":20}],"constraints":"1 <= target <= 10^9","time_limit_ms":500,"problem_statement":"Starting from 1 and repeatedly doubling, return the minimum number of doublings needed to reach or exceed a target value.","reference_solution":"def solve(target):\n n = 1\n steps = 0\n while n < target:\n n *= 2\n steps += 1\n return steps\n"}} {"submissionId":"cmsxa84x500erkup2f5pjl153","title":"Submission PJL153","payload":{"test_cases":[{"input":[[1,1,0,1,1,1]],"output":3},{"input":[[0,0,0]],"output":0},{"input":[[]],"output":0},{"input":[[1,1,1]],"output":3},{"input":[[1,0,1,0,1]],"output":1}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of 0s and 1s, return the length of the longest run of consecutive 1s.","reference_solution":"def solve(nums):\n longest = 0\n current = 0\n for x in nums:\n if x == 1:\n current += 1\n longest = max(longest, current)\n else:\n current = 0\n return longest\n"}} {"submissionId":"cmsxa84x500eskup26qpo72ws","title":"Submission PO72WS","payload":{"test_cases":[{"input":[[1,2,2,3,3,3]],"output":3},{"input":[[]],"output":0},{"input":[[5]],"output":0},{"input":[[1,1,1,1]],"output":3},{"input":[[1,2,3]],"output":0}],"constraints":"0 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a list, return the number of 'extra' duplicate elements, i.e. total length minus the number of distinct values.","reference_solution":"def solve(nums):\n return len(nums) - len(set(nums))\n"}} {"submissionId":"cmsxa84x500etkup2jvgik3of","title":"Submission GIK3OF","payload":{"test_cases":[{"input":[5],"output":1},{"input":[10],"output":2},{"input":[25],"output":6},{"input":[0],"output":0},{"input":[100],"output":24}],"constraints":"0 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, return the number of trailing zeros in n! (n factorial), without computing the factorial directly.","reference_solution":"def solve(n):\n count = 0\n power = 5\n while power <= n:\n count += n // power\n power *= 5\n return count\n"}} {"submissionId":"cmsxa84x500eukup2ycmkq900","title":"Submission MKQ900","payload":{"test_cases":[{"input":[[1,3,5,8],10],"output":[1,8]},{"input":[[1,2],3],"output":[1,2]},{"input":[[-5,0,5],1],"output":[-5,5]},{"input":[[10,20,30],25],"output":[10,20]},{"input":[[1,1,1],5],"output":[1,1]}],"constraints":"2 <= len(nums) <= 200","time_limit_ms":500,"problem_statement":"Given a list of integers and a target sum, find the pair of two distinct-index elements whose sum is closest to the target, and return that pair as [a, b].","reference_solution":"def solve(nums, target):\n best_pair = None\n best_diff = None\n n = len(nums)\n for i in range(n):\n for j in range(i+1, n):\n diff = abs(nums[i] + nums[j] - target)\n if best_diff is None or diff < best_diff:\n best_diff = diff\n best_pair = [nums[i], nums[j]]\n return best_pair\n"}} {"submissionId":"cmsxa84x500evkup2k4rg59ls","title":"Submission RG59LS","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":2},{"input":[[5]],"output":0},{"input":[[1,1,1]],"output":0},{"input":[[10,20,30]],"output":1},{"input":[[-5,0,5]],"output":1}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of numbers, count how many elements are strictly greater than the average of the list.","reference_solution":"def solve(nums):\n avg = sum(nums) / len(nums)\n return sum(1 for x in nums if x > avg)\n"}} {"submissionId":"cmsxa84x500ewkup26dp0pzqd","title":"Submission P0PZQD","payload":{"test_cases":[{"input":[[1,2,3,4,5]],"output":2},{"input":[[5]],"output":0},{"input":[[1,1,1]],"output":0},{"input":[[10,20,30,40]],"output":2},{"input":[[-5,0,5]],"output":1}],"constraints":"1 <= len(nums) <= 1000","time_limit_ms":500,"problem_statement":"Given a non-empty list of numbers, count how many elements are strictly greater than the median of the list.","reference_solution":"def solve(nums):\n sorted_nums = sorted(nums)\n n = len(sorted_nums)\n if n % 2 == 1:\n median = sorted_nums[n // 2]\n else:\n median = (sorted_nums[n // 2 - 1] + sorted_nums[n // 2]) / 2\n return sum(1 for x in nums if x > median)\n"}} {"submissionId":"cmsxa84x500exkup24mg4nqav","title":"Submission G4NQAV","payload":{"test_cases":[{"input":[[[1,3],[4,6],[7,9]],6],"output":2},{"input":[[],10],"output":0},{"input":[[[1,2]],1],"output":0},{"input":[[[1,5],[6,10]],5],"output":1},{"input":[[[0,1],[2,3],[4,5]],100],"output":3}],"constraints":"0 <= len(meetings) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of [start, end] meeting intervals (already non-overlapping) and a deadline, count how many meetings finish at or before the deadline.","reference_solution":"def solve(meetings, deadline):\n return sum(1 for start, end in meetings if end <= deadline)\n"}} {"submissionId":"cmsxa84x500eykup2f19xp4w1","title":"Submission 9XP4W1","payload":{"test_cases":[{"input":["aabbbcc",2],"output":["b","a"]},{"input":["",3],"output":[]},{"input":["x",1],"output":["x"]},{"input":["abcabc",6],"output":["a","b","c"]},{"input":["zzzyyx",2],"output":["z","y"]}],"constraints":"0 <= len(s) <= 1000, 0 <= n <= 100","time_limit_ms":500,"problem_statement":"Given a string and an integer n, return a list of the n most common characters, ordered by descending frequency (ties broken by character ascending).","reference_solution":"def solve(s, n):\n from collections import Counter\n counts = Counter(s)\n items = sorted(counts.items(), key=lambda kv: (-kv[1], kv[0]))\n return [c for c, _ in items[:n]]\n"}} {"submissionId":"cmsxa84x500ezkup25t5smwek","title":"Submission 5SMWEK","payload":{"test_cases":[{"input":["abc"],"output":294},{"input":[""],"output":0},{"input":["A"],"output":65},{"input":["hello"],"output":532},{"input":[" "],"output":64}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return the sum of the ASCII (ordinal) values of its characters.","reference_solution":"def solve(s):\n return sum(ord(c) for c in s)\n"}} {"submissionId":"cmsxa84x500f0kup2traymlfb","title":"Submission AYMLFB","payload":{"test_cases":[{"input":["abc"],"output":[97,98,99]},{"input":[""],"output":[]},{"input":["A"],"output":[65]},{"input":["hi"],"output":[104,105]},{"input":[" "],"output":[32]}],"constraints":"0 <= len(s) <= 1000","time_limit_ms":500,"problem_statement":"Given a string, return a list of the ASCII (ordinal) value of each character, in order.","reference_solution":"def solve(s):\n return [ord(c) for c in s]\n"}} {"submissionId":"cmsxa84x500f1kup2o9v1t60k","title":"Submission V1T60K","payload":{"test_cases":[{"input":[[104,105]],"output":"hi"},{"input":[[]],"output":""},{"input":[[65]],"output":"A"},{"input":[[72,101,108,108,111]],"output":"Hello"},{"input":[[32,33]],"output":" !"}],"constraints":"0 <= len(codes) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of ASCII (ordinal) codes, return the string formed by converting each code to its character.","reference_solution":"def solve(codes):\n return ''.join(chr(c) for c in codes)\n"}} {"submissionId":"cmsxa84x500f2kup2e2rrmwjx","title":"Submission RRMWJX","payload":{"test_cases":[{"input":[[1,2,3,4,5],[4,5,3,2,1]],"output":true},{"input":[[1,2,3,4,5],[4,3,5,1,2]],"output":false},{"input":[[],[]],"output":true},{"input":[[1],[1]],"output":true},{"input":[[1,2],[1,2]],"output":true}],"constraints":"0 <= len(pushed) == len(popped) <= 1000","time_limit_ms":500,"problem_statement":"Given a 'pushed' sequence and a 'popped' sequence of the same set of values, determine whether 'popped' could be a valid pop order for a stack that receives pushes in the order given by 'pushed'.","reference_solution":"def solve(pushed, popped):\n stack = []\n i = 0\n for x in pushed:\n stack.append(x)\n while stack and i < len(popped) and stack[-1] == popped[i]:\n stack.pop()\n i += 1\n return i == len(popped)\n"}} {"submissionId":"cmsxa84x500f3kup29fiko1yf","title":"Submission IKO1YF","payload":{"test_cases":[{"input":[[1,2,3]],"output":1},{"input":[[1,[2,[3,[4]]]]],"output":4},{"input":[[]],"output":1},{"input":[[[1],[2,[3]]]],"output":3},{"input":[[1,[2],[3,[4,[5]]]]],"output":4}],"constraints":"0 <= total elements <= 500","time_limit_ms":500,"problem_statement":"Given a (possibly deeply) nested list, return the maximum nesting depth (a non-nested list has depth 1).","reference_solution":"def solve(nested):\n if not isinstance(nested, list):\n return 0\n if not nested:\n return 1\n return 1 + max((solve(item) for item in nested), default=0)\n"}} {"submissionId":"cmsxa84x500f4kup26mw4ir8z","title":"Submission W4IR8Z","payload":{"test_cases":[{"input":[[1,2,3]],"output":3},{"input":[[1,[2,3],[4,[5,6]]]],"output":6},{"input":[[]],"output":0},{"input":[[[1,[2,[3]]]]],"output":3},{"input":[[1,[],2]],"output":2}],"constraints":"0 <= total elements <= 500","time_limit_ms":500,"problem_statement":"Given a (possibly nested) list, count the number of non-list 'leaf' elements it contains, at any depth.","reference_solution":"def solve(nested):\n count = 0\n for item in nested:\n if isinstance(item, list):\n count += solve(item)\n else:\n count += 1\n return count\n"}} {"submissionId":"cmsxa84x500f5kup23l935wxx","title":"Submission 935WXX","payload":{"test_cases":[{"input":[[[1,3],[2,6],[8,10]]],"output":[[1,6],[8,10]]},{"input":[[]],"output":[]},{"input":[[[1,2]]],"output":[[1,2]]},{"input":[[[1,4],[4,5]]],"output":[[1,5]]},{"input":[[[1,10],[2,3],[4,5]]],"output":[[1,10]]}],"constraints":"0 <= len(intervals) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of [start, end] intervals, merge all overlapping intervals and return the resulting list sorted by start.","reference_solution":"def solve(intervals):\n if not intervals:\n return []\n intervals = sorted([list(iv) for iv in intervals], key=lambda x: x[0])\n merged = [intervals[0]]\n for start, end in intervals[1:]:\n last = merged[-1]\n if start <= last[1]:\n last[1] = max(last[1], end)\n else:\n merged.append([start, end])\n return merged\n"}} {"submissionId":"cmsxa84x500f6kup2xm9t0p2j","title":"Submission 9T0P2J","payload":{"test_cases":[{"input":[[[1,3],[2,6],[8,10]]],"output":7},{"input":[[]],"output":0},{"input":[[[1,2]]],"output":1},{"input":[[[1,4],[4,5]]],"output":4},{"input":[[[1,10],[2,3],[4,5]]],"output":9}],"constraints":"0 <= len(intervals) <= 1000","time_limit_ms":500,"problem_statement":"Given a list of [start, end] intervals, return the total length covered on the number line after merging overlaps.","reference_solution":"def solve(intervals):\n if not intervals:\n return 0\n intervals = sorted([list(iv) for iv in intervals], key=lambda x: x[0])\n merged = [list(intervals[0])]\n for start, end in intervals[1:]:\n last = merged[-1]\n if start <= last[1]:\n last[1] = max(last[1], end)\n else:\n merged.append([start, end])\n return sum(e - s for s, e in merged)\n"}} {"submissionId":"cmsy7dcxw00ozkup269a2o5lq","title":"Submission A2O5LQ","payload":{"test_cases":[{"input":["hello world","wor"],"output":true},{"input":["abcdef","xyz"],"output":false},{"input":["banana","nan"],"output":true},{"input":["test","test"],"output":true}],"constraints":"1 <= len(s), len(sub) <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string s and a string sub, determine whether sub appears anywhere within s.","reference_solution":"def solve(s, sub):\n return sub in s\n"}} {"submissionId":"cmsy7dcxw00p0kup2k1zhmgf8","title":"Submission ZHMGF8","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":4},{"input":[[2,4,6]],"output":0},{"input":[[1,3,5]],"output":9},{"input":[[-1,-2,-3]],"output":-4}],"constraints":"1 <= n <= 10^5, -10^4 <= value <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the sum of all odd numbers in it.","reference_solution":"def solve(nums):\n return sum(n for n in nums if n % 2 != 0)\n"}} {"submissionId":"cmsy7dcxw00p1kup2tw37d6re","title":"Submission 37D6RE","payload":{"test_cases":[{"input":[[3,1,2]],"output":1},{"input":[[5,5,5]],"output":0},{"input":[[7]],"output":0},{"input":[[-1,-5,-3,-5]],"output":1}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a non-empty array of integers, return the index of the first occurrence of the minimum element.","reference_solution":"def solve(nums):\n min_val = min(nums)\n return nums.index(min_val)\n"}} {"submissionId":"cmsy7dcxw00p2kup20njtujqq","title":"Submission JTUJQQ","payload":{"test_cases":[{"input":[5],"output":"101"},{"input":[0],"output":"0"},{"input":[10],"output":"1010"},{"input":[255],"output":"11111111"}],"constraints":"0 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, return its binary representation as a string (no leading '0b').","reference_solution":"def solve(n):\n return bin(n)[2:]\n"}} {"submissionId":"cmsy7dcxw00p3kup20x25fjna","title":"Submission 25FJNA","payload":{"test_cases":[{"input":[4],"output":true},{"input":[7],"output":false},{"input":[0],"output":true},{"input":[-6],"output":true}],"constraints":"-10^9 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given an integer n, determine whether it is even.","reference_solution":"def solve(n):\n return n % 2 == 0\n"}} {"submissionId":"cmsy7dcxw00p4kup2ifwqof5e","title":"Submission WQOF5E","payload":{"test_cases":[{"input":[123],"output":321},{"input":[-456],"output":-654},{"input":[100],"output":1},{"input":[7],"output":7}],"constraints":"-10^9 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given an integer n (which may be negative), return the integer formed by reversing its digits, preserving the sign.","reference_solution":"def solve(n):\n sign = -1 if n < 0 else 1\n return sign * int(str(abs(n))[::-1])\n"}} {"submissionId":"cmsy7dcxw00p5kup24wu68kvk","title":"Submission U68KVK","payload":{"test_cases":[{"input":[[1,2,2,3]],"output":2},{"input":[[4,4,4,1,1]],"output":4},{"input":[[7]],"output":7},{"input":[[1,1,2,2,2]],"output":2}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers with a unique mode, return the value that occurs most frequently.","reference_solution":"def solve(nums):\n from collections import Counter\n cnt = Counter(nums)\n max_count = max(cnt.values())\n for n in nums:\n if cnt[n] == max_count:\n return n\n"}} {"submissionId":"cmsy7dcxw00p6kup2obcnqxzo","title":"Submission CNQXZO","payload":{"test_cases":[{"input":[[1,2,3]],"output":true},{"input":[[1,-2,3]],"output":false},{"input":[[0,1,2]],"output":false},{"input":[[5]],"output":true}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, determine whether all elements are strictly positive.","reference_solution":"def solve(nums):\n return all(n > 0 for n in nums)\n"}} {"submissionId":"cmsy7dcxw00p7kup2yv9ocv14","title":"Submission 9OCV14","payload":{"test_cases":[{"input":["Hello World"],"output":2},{"input":["abc"],"output":0},{"input":["ABC"],"output":3},{"input":["HeLLo"],"output":3}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, count the number of uppercase letters in it.","reference_solution":"def solve(s):\n return sum(1 for c in s if c.isupper())\n"}} {"submissionId":"cmsy7dcxw00p8kup2hhgtbtbs","title":"Submission GTBTBS","payload":{"test_cases":[{"input":[1],"output":1},{"input":[5],"output":15},{"input":[10],"output":55},{"input":[100],"output":5050}],"constraints":"1 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given a positive integer n, return the sum of all natural numbers from 1 to n.","reference_solution":"def solve(n):\n return n * (n + 1) // 2\n"}} {"submissionId":"cmsy7dcxw00p9kup20w5db47y","title":"Submission 5DB47Y","payload":{"test_cases":[{"input":["hello world","world"],"output":true},{"input":["hello","hell"],"output":false},{"input":["abc","abc"],"output":true},{"input":["abcdef","cdef"],"output":true}],"constraints":"1 <= length of s, suffix <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string s and a string suffix, determine whether s ends with suffix.","reference_solution":"def solve(s, suffix):\n return s.endswith(suffix)\n"}} {"submissionId":"cmsy7dcxw00pakup2czcdbx64","title":"Submission CDBX64","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":4},{"input":[[7]],"output":0},{"input":[[-5,10]],"output":15},{"input":[[2,2,2]],"output":0}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a non-empty array of integers, return the difference between the maximum and minimum elements.","reference_solution":"def solve(nums):\n return max(nums) - min(nums)\n"}} {"submissionId":"cmsy7dcxw00pbkup23e6ou8q8","title":"Submission 6OU8Q8","payload":{"test_cases":[{"input":[[1,2,3],[1,2,3]],"output":true},{"input":[[1,2],[2,1]],"output":false},{"input":[[],[]],"output":true},{"input":[[1],[1,2]],"output":false}],"constraints":"0 <= len(a), len(b) <= 10^5","time_limit_ms":1000,"problem_statement":"Given two arrays of integers, determine whether they are equal (same length, same elements in the same order).","reference_solution":"def solve(a, b):\n return a == b\n"}} {"submissionId":"cmsy7dcxw00pckup2dk4w0luw","title":"Submission 4W0LUW","payload":{"test_cases":[{"input":[[1,5,3,8],3],"output":2},{"input":[[1,2,3],10],"output":0},{"input":[[5,5,5],4],"output":3},{"input":[[-1,0,1],-2],"output":3}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers and a threshold value, count how many elements are strictly greater than the threshold.","reference_solution":"def solve(nums, threshold):\n return sum(1 for n in nums if n > threshold)\n"}} {"submissionId":"cmsy7dcxw00pdkup20e6hj3d0","title":"Submission 6HJ3D0","payload":{"test_cases":[{"input":[153],"output":true},{"input":[123],"output":false},{"input":[9474],"output":true},{"input":[10],"output":false}],"constraints":"1 <= n <= 10^7","time_limit_ms":1000,"problem_statement":"Given a positive integer n, determine whether it is an Armstrong number (equal to the sum of its own digits each raised to the power of the number of digits).","reference_solution":"def solve(n):\n digits = str(n)\n power = len(digits)\n return n == sum(int(d)**power for d in digits)\n"}} {"submissionId":"cmsy7dcxw00pekup288jb68ms","title":"Submission JB68MS","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[[1,3],[2,4]]},{"input":[[[1,2,3]]],"output":[[1],[2],[3]]},{"input":[[[1],[2],[3]]],"output":[[1,2,3]]},{"input":[[[1,0],[0,1]]],"output":[[1,0],[0,1]]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":1000,"problem_statement":"Given a 2D array (list of lists) representing a matrix, return its transpose.","reference_solution":"def solve(matrix):\n return [list(row) for row in zip(*matrix)]\n"}} {"submissionId":"cmsy7dcxw00pfkup2dmxjvjb6","title":"Submission XJVJB6","payload":{"test_cases":[{"input":["12345"],"output":true},{"input":["12a45"],"output":false},{"input":["0"],"output":true},{"input":["007"],"output":true}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, determine whether it consists only of decimal digit characters (0-9), and is non-empty.","reference_solution":"def solve(s):\n return s.isdigit()\n"}} {"submissionId":"cmsy7dcxw00pgkup2u1m4zz1f","title":"Submission M4ZZ1F","payload":{"test_cases":[{"input":[[1,2,3],[2,3,4]],"output":[1,2,3,4]},{"input":[[1,1],[1,1]],"output":[1]},{"input":[[5],[10]],"output":[5,10]},{"input":[[1,2],[]],"output":[1,2]}],"constraints":"1 <= len(a), len(b) <= 10^5","time_limit_ms":1000,"problem_statement":"Given two arrays of integers, return a sorted array of all distinct values that appear in either array.","reference_solution":"def solve(a, b):\n return sorted(set(a) | set(b))\n"}} {"submissionId":"cmsy7dcxw00phkup2d7bo7gw9","title":"Submission BO7GW9","payload":{"test_cases":[{"input":[0],"output":32},{"input":[100],"output":212},{"input":[-40],"output":-40},{"input":[37],"output":98.6}],"constraints":"-273 <= c <= 10^4","time_limit_ms":1000,"problem_statement":"Given a temperature in Celsius, convert it to Fahrenheit, rounded to 2 decimal places.","reference_solution":"def solve(c):\n return round(c * 9 / 5 + 32, 2)\n"}} {"submissionId":"cmsy7dcxw00pikup21v9svwko","title":"Submission 9SVWKO","payload":{"test_cases":[{"input":["(())"],"output":true},{"input":["(()"],"output":false},{"input":["()()"],"output":true},{"input":[")("],"output":false}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string containing only parenthesis characters '(' and ')', determine whether the parentheses are balanced.","reference_solution":"def solve(s):\n depth = 0\n for c in s:\n if c == '(':\n depth += 1\n elif c == ')':\n depth -= 1\n if depth < 0:\n return False\n return depth == 0\n"}} {"submissionId":"cmszmxkld002owvp21qz196yv","title":"Submission Z196YV","payload":{"test_cases":[{"input":["Hello World"],"output":8},{"input":["ABC"],"output":0},{"input":["abc"],"output":3},{"input":["HeLLo"],"output":2}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, count the number of lowercase letters in it.","reference_solution":"def solve(s):\n return sum(1 for c in s if c.islower())\n"}} {"submissionId":"cmszmxkld002pwvp2uc2vd6sf","title":"Submission 2VD6SF","payload":{"test_cases":[{"input":["hello world"],"output":"helloworld"},{"input":[" a b c "],"output":"abc"},{"input":["noSpaces"],"output":"noSpaces"},{"input":["multi space"],"output":"multispace"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, remove all whitespace characters (spaces, tabs, newlines) from it and return the result.","reference_solution":"def solve(s):\n return \"\".join(s.split())\n"}} {"submissionId":"cmszmxkld002swvp2mjb6paew","title":"Submission B6PAEW","payload":{"test_cases":[{"input":[[1,2,3],[1,5,3]],"output":2},{"input":[[1,2,3],[4,5,6]],"output":0},{"input":[[1,1,1],[1,1,1]],"output":3},{"input":[[1,2],[2,1]],"output":0}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given two arrays of integers of the same length, count how many positions have equal values in both arrays.","reference_solution":"def solve(a, b):\n return sum(1 for x, y in zip(a, b) if x == y)\n"}} {"submissionId":"cmszmxkle002twvp22miq30fz","title":"Submission IQ30FZ","payload":{"test_cases":[{"input":[122333,3],"output":3},{"input":[100,0],"output":2},{"input":[5,5],"output":1},{"input":[123456789,7],"output":1}],"constraints":"0 <= n <= 10^18, 0 <= d <= 9","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n and a single digit d (0-9), count how many times d appears in the decimal representation of n.","reference_solution":"def solve(n, d):\n return str(n).count(str(d))\n"}} {"submissionId":"cmszmxkle002uwvp2t80i7ymm","title":"Submission 0I7YMM","payload":{"test_cases":[{"input":[6],"output":true},{"input":[28],"output":true},{"input":[12],"output":false},{"input":[1],"output":false}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a positive integer n, determine whether it is a perfect number (equal to the sum of its proper divisors, excluding itself).","reference_solution":"def solve(n):\n if n < 2:\n return False\n divisor_sum = sum(i for i in range(1, n) if n % i == 0)\n return divisor_sum == n\n"}} {"submissionId":"cmszmxkle002vwvp2m15m22i3","title":"Submission 5M22I3","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[1,2,3,4]},{"input":[[[1],[2,3],[]]],"output":[1,2,3]},{"input":[[[5]]],"output":[5]},{"input":[[[1,2,3]]],"output":[1,2,3]}],"constraints":"1 <= n <= 10^4","time_limit_ms":1000,"problem_statement":"Given a list of lists of integers, flatten it by one level into a single list, preserving order.","reference_solution":"def solve(nested):\n result = []\n for sub in nested:\n result.extend(sub)\n return result\n"}} {"submissionId":"cmszmxkle002wwvp23awa3yew","title":"Submission WA3YEW","payload":{"test_cases":[{"input":[[3,1,4,1,5],2],"output":4},{"input":[[7],1],"output":7},{"input":[[9,3,7,1],3],"output":3},{"input":[[5,5,5],2],"output":5}],"constraints":"1 <= k <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers and a positive integer k, return the k-th largest element (1st largest is the maximum).","reference_solution":"def solve(nums, k):\n return sorted(nums, reverse=True)[k-1]\n"}} {"submissionId":"cmszmxkle002xwvp2rubspf6g","title":"Submission BSPF6G","payload":{"test_cases":[{"input":["123"],"output":123},{"input":["-45"],"output":-45},{"input":["+7"],"output":7},{"input":["0"],"output":0}],"constraints":"1 <= length <= 15","time_limit_ms":1000,"problem_statement":"Given a string representing an integer (optionally prefixed with '+' or '-'), parse and return it as an integer, without using built-in int() conversion functions directly on the whole string.","reference_solution":"def solve(s):\n sign = 1\n i = 0\n if s[0] == '-':\n sign = -1\n i = 1\n elif s[0] == '+':\n i = 1\n num = 0\n for c in s[i:]:\n num = num * 10 + int(c)\n return sign * num\n"}} {"submissionId":"cmszmxkle002ywvp2plddvd98","title":"Submission DDVD98","payload":{"test_cases":[{"input":["cat car care dog","ca"],"output":3},{"input":["apple banana avocado","a"],"output":2},{"input":["hello world","x"],"output":0},{"input":["aa ab ac ad","a"],"output":4}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence of space-separated words and a prefix string, count how many words start with that prefix.","reference_solution":"def solve(sentence, prefix):\n return sum(1 for w in sentence.split() if w.startswith(prefix))\n"}} {"submissionId":"cmszmxkle002zwvp2upmtbv46","title":"Submission MTBV46","payload":{"test_cases":[{"input":["waterbottle","erbottlewat"],"output":true},{"input":["hello","llohe"],"output":true},{"input":["hello","olleh"],"output":false},{"input":["abc","abc"],"output":true}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given two strings s1 and s2, determine whether s2 is a rotation of s1 (s2 can be obtained by moving some prefix of s1 to its end).","reference_solution":"def solve(s1, s2):\n return len(s1) == len(s2) and s2 in (s1 + s1)\n"}} {"submissionId":"cmszmxkle0030wvp2njqzct4g","title":"Submission QZCT4G","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":5},{"input":[[[5]]],"output":5},{"input":[[[1,0,0],[0,1,0],[0,0,1]]],"output":3},{"input":[[[1,2,3],[4,5,6],[7,8,9]]],"output":15}],"constraints":"1 <= n <= 100","time_limit_ms":1000,"problem_statement":"Given a square matrix (list of lists) of integers, return the sum of its main diagonal elements.","reference_solution":"def solve(matrix):\n return sum(matrix[i][i] for i in range(len(matrix)))\n"}} {"submissionId":"cmszmxkle0031wvp2jx2evuij","title":"Submission 2EVUIJ","payload":{"test_cases":[{"input":[[1,2,3,1,2]],"output":3},{"input":[[5,4,3]],"output":1},{"input":[[1]],"output":1},{"input":[[1,2,2,3,4]],"output":3}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the length of the longest run of consecutive strictly increasing elements.","reference_solution":"def solve(nums):\n if not nums:\n return 0\n best = cur = 1\n for i in range(1, len(nums)):\n if nums[i] > nums[i-1]:\n cur += 1\n best = max(best, cur)\n else:\n cur = 1\n return best\n"}} {"submissionId":"cmszmxkle0032wvp20096yx9r","title":"Submission 96YX9R","payload":{"test_cases":[{"input":[[1,-2,3,-4]],"output":2},{"input":[[1,2,3]],"output":0},{"input":[[-1,-2,-3]],"output":3},{"input":[[0,0]],"output":0}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, count how many elements are strictly negative.","reference_solution":"def solve(nums):\n return sum(1 for n in nums if n < 0)\n"}} {"submissionId":"cmszmxkle0033wvp23d7romio","title":"Submission 7ROMIO","payload":{"test_cases":[{"input":["Hello World"],"output":"hELLO wORLD"},{"input":["ABC"],"output":"abc"},{"input":["abc"],"output":"ABC"},{"input":["MiXeD123"],"output":"mIxEd123"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, swap the case of every letter (uppercase becomes lowercase and vice versa), leaving non-letter characters unchanged.","reference_solution":"def solve(s):\n return s.swapcase()\n"}} {"submissionId":"cmszmxkle0034wvp2qzqvdrc9","title":"Submission QVDRC9","payload":{"test_cases":[{"input":[[1,2],[1,2,3]],"output":true},{"input":[[1,4],[1,2,3]],"output":false},{"input":[[1,1,1],[1]],"output":true},{"input":[[],[1,2]],"output":true}],"constraints":"1 <= len(a), len(b) <= 10^5","time_limit_ms":1000,"problem_statement":"Given two arrays of integers a and b, determine whether every distinct value in a also appears in b.","reference_solution":"def solve(a, b):\n return set(a).issubset(set(b))\n"}} {"submissionId":"cmszmxkle0035wvp27zikj1ck","title":"Submission IKJ1CK","payload":{"test_cases":[{"input":["101"],"output":5},{"input":["0"],"output":0},{"input":["1010"],"output":10},{"input":["11111111"],"output":255}],"constraints":"1 <= length <= 32","time_limit_ms":1000,"problem_statement":"Given a string representing a binary number (containing only '0' and '1'), return its decimal integer value.","reference_solution":"def solve(s):\n return int(s, 2)\n"}} {"submissionId":"cmszmxkle0036wvp2qiknwvkz","title":"Submission KNWVKZ","payload":{"test_cases":[{"input":[[2,2,1]],"output":1},{"input":[[4,1,2,1,2]],"output":4},{"input":[[1]],"output":1},{"input":[[5,3,5,3,9]],"output":9}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers where every element appears exactly twice except for one which appears exactly once, find that single element.","reference_solution":"def solve(nums):\n result = 0\n for n in nums:\n result ^= n\n return result\n"}} {"submissionId":"cmszmxkle0037wvp2uaxb5c3c","title":"Submission XB5C3C","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":3},{"input":[[2,4,6]],"output":4},{"input":[[1,2,1,4]],"output":3},{"input":[[10,20,3]],"output":15}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers containing at least one even number, return the average of the even numbers, rounded to 2 decimal places.","reference_solution":"def solve(nums):\n evens = [n for n in nums if n % 2 == 0]\n return round(sum(evens) / len(evens), 2)\n"}} {"submissionId":"cmszn1kts0039wvp2vy5qm2sr","title":"Submission 5QM2SR","payload":{"test_cases":[{"input":["The quick brown fox jumps over the lazy dog"],"output":true},{"input":["hello world"],"output":false},{"input":["abcdefghijklmnopqrstuvwxyz"],"output":true},{"input":["abc"],"output":false}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, determine whether it is a pangram (contains every letter of the English alphabet at least once, case-insensitive).","reference_solution":"def solve(s):\n return set('abcdefghijklmnopqrstuvwxyz').issubset(set(s.lower()))\n"}} {"submissionId":"cmszn1kts003awvp2qolbb6y6","title":"Submission LBB6Y6","payload":{"test_cases":[{"input":[[1,2,3]],"output":14},{"input":[[-2,2]],"output":8},{"input":[[0]],"output":0},{"input":[[5]],"output":25}],"constraints":"1 <= n <= 10^5, -10^3 <= value <= 10^3","time_limit_ms":1000,"problem_statement":"Given an array of integers, return the sum of the squares of all elements.","reference_solution":"def solve(nums):\n return sum(n*n for n in nums)\n"}} {"submissionId":"cmszn1kts003bwvp2fxj4s5ya","title":"Submission J4S5YA","payload":{"test_cases":[{"input":[[1,5,3,4,2],2],"output":3},{"input":[[1,1,1],0],"output":3},{"input":[[1,2,3],5],"output":0},{"input":[[3,3],0],"output":1}],"constraints":"1 <= n <= 1000, 0 <= diff <= 10^4","time_limit_ms":1000,"problem_statement":"Given an array of integers and a non-negative integer diff, count the number of unordered pairs of elements (by value, considering duplicates as separate items) whose absolute difference equals diff.","reference_solution":"def solve(nums, diff):\n from collections import Counter\n cnt = Counter(nums)\n total = 0\n for x in cnt:\n if diff == 0:\n if cnt[x] > 1:\n total += cnt[x] * (cnt[x]-1) // 2\n else:\n if x + diff in cnt:\n total += cnt[x] * cnt[x+diff]\n return total\n"}} {"submissionId":"cmszn1kts003cwvp2iy38w852","title":"Submission 38W852","payload":{"test_cases":[{"input":["Hello World"],"output":"Hll Wrld"},{"input":["aeiou"],"output":""},{"input":["xyz"],"output":"xyz"},{"input":["Programming"],"output":"Prgrmmng"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, remove all vowels (a, e, i, o, u, case-insensitive) from it and return the result.","reference_solution":"def solve(s):\n return \"\".join(c for c in s if c.lower() not in \"aeiou\")\n"}} {"submissionId":"cmszn1kts003dwvp2p5b5k1mb","title":"Submission B5K1MB","payload":{"test_cases":[{"input":[[[1,2],[2,1]]],"output":true},{"input":[[[1,2],[3,4]]],"output":false},{"input":[[[5]]],"output":true},{"input":[[[1,2,3],[2,4,5],[3,5,6]]],"output":true}],"constraints":"1 <= n <= 100","time_limit_ms":1000,"problem_statement":"Given a square matrix (list of lists) of integers, determine whether it is symmetric (equal to its own transpose).","reference_solution":"def solve(matrix):\n n = len(matrix)\n for i in range(n):\n for j in range(n):\n if matrix[i][j] != matrix[j][i]:\n return False\n return True\n"}} {"submissionId":"cmszn1kts003ewvp2h1egx2qk","title":"Submission EGX2QK","payload":{"test_cases":[{"input":[[1,1,0,1,1,1]],"output":3},{"input":[[0,0,0]],"output":0},{"input":[[1]],"output":1},{"input":[[1,0,1,0,1]],"output":1}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a binary array (containing only 0s and 1s), return the maximum number of consecutive 1s in the array.","reference_solution":"def solve(nums):\n best = cur = 0\n for n in nums:\n if n == 1:\n cur += 1\n best = max(best, cur)\n else:\n cur = 0\n return best\n"}} {"submissionId":"cmszn1kts003fwvp2l6p7io1n","title":"Submission P7IO1N","payload":{"test_cases":[{"input":["aaabbbccd"],"output":"a3b3c2d1"},{"input":["abc"],"output":"a1b1c1"},{"input":["aaaa"],"output":"a4"},{"input":["a"],"output":"a1"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string of characters, perform run-length encoding: replace consecutive repeated characters with the character followed by its count.","reference_solution":"def solve(s):\n if not s:\n return \"\"\n result = []\n prev = s[0]\n count = 1\n for c in s[1:]:\n if c == prev:\n count += 1\n else:\n result.append(prev + str(count))\n prev = c\n count = 1\n result.append(prev + str(count))\n return \"\".join(result)\n"}} {"submissionId":"cmszn1kts003gwvp2rgb7yngo","title":"Submission B7YNGO","payload":{"test_cases":[{"input":[27],"output":true},{"input":[10],"output":false},{"input":[1],"output":true},{"input":[243],"output":true}],"constraints":"1 <= n <= 10^9","time_limit_ms":1000,"problem_statement":"Given a positive integer n, determine whether it is a power of three.","reference_solution":"def solve(n):\n if n < 1:\n return False\n while n % 3 == 0:\n n //= 3\n return n == 1\n"}} {"submissionId":"cmszn1kts003hwvp2z959gylj","title":"Submission 59GYLJ","payload":{"test_cases":[{"input":["abcabc"],"output":3},{"input":["abcdef"],"output":-1},{"input":["aabbcc"],"output":1},{"input":["z"],"output":-1}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string, return the index of the first character that is a repeat of an earlier character in the string. Return -1 if there are no repeats.","reference_solution":"def solve(s):\n seen = set()\n for i, c in enumerate(s):\n if c in seen:\n return i\n seen.add(c)\n return -1\n"}} {"submissionId":"cmszn1kts003iwvp2a0rpm6uu","title":"Submission RPM6UU","payload":{"test_cases":[{"input":[[1,2,3,4]],"output":-4},{"input":[[5,5,5,5]],"output":0},{"input":[[1,1,10,10]],"output":-18},{"input":[[0,0,0,0]],"output":0}],"constraints":"2 <= n <= 10^5, n is even","time_limit_ms":1000,"problem_statement":"Given an array of integers with even length, split it into a left half and right half of equal size, and return the difference between the sum of the left half and the sum of the right half.","reference_solution":"def solve(nums):\n n = len(nums)\n mid = n // 2\n return sum(nums[:mid]) - sum(nums[mid:])\n"}} {"submissionId":"cmszn1kts003kwvp2jqabmws8","title":"Submission ABMWS8","payload":{"test_cases":[{"input":["flower","flow"],"output":4},{"input":["hello","world"],"output":0},{"input":["abc","abcdef"],"output":3},{"input":["xyz","abc"],"output":0}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given two strings s1 and s2, return the length of their longest common prefix.","reference_solution":"def solve(s1, s2):\n count = 0\n for a, b in zip(s1, s2):\n if a == b:\n count += 1\n else:\n break\n return count\n"}} {"submissionId":"cmszn1kts003lwvp2xpf9a4xe","title":"Submission F9A4XE","payload":{"test_cases":[{"input":[[[1,2,3],[4,1,2],[5,4,1]]],"output":true},{"input":[[[1,2],[2,2]]],"output":false},{"input":[[[5]]],"output":true},{"input":[[[1,2],[3,1]]],"output":true}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":1000,"problem_statement":"Given a matrix (list of lists) of integers, determine whether it is a Toeplitz matrix: every diagonal from top-left to bottom-right has the same value.","reference_solution":"def solve(matrix):\n rows = len(matrix)\n cols = len(matrix[0])\n for i in range(rows-1):\n for j in range(cols-1):\n if matrix[i][j] != matrix[i+1][j+1]:\n return False\n return True\n"}} {"submissionId":"cmszn1kts003mwvp2attr83gs","title":"Submission TR83GS","payload":{"test_cases":[{"input":[[2,1,5,1,3,2],3],"output":9},{"input":[[1,2,3],2],"output":5},{"input":[[5],1],"output":5},{"input":[[-1,-2,-3,-4],2],"output":-3}],"constraints":"1 <= k <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers and a positive integer k, return the maximum sum of any contiguous subarray of exactly k elements.","reference_solution":"def solve(nums, k):\n window = sum(nums[:k])\n best = window\n for i in range(k, len(nums)):\n window += nums[i] - nums[i-k]\n best = max(best, window)\n return best\n"}} {"submissionId":"cmszn1kts003nwvp2uq6pbuy4","title":"Submission 6PBUY4","payload":{"test_cases":[{"input":[19],"output":true},{"input":[2],"output":false},{"input":[1],"output":true},{"input":[7],"output":true}],"constraints":"1 <= n <= 10^6","time_limit_ms":1000,"problem_statement":"Given a positive integer n, determine whether it is a happy number: repeatedly replace it with the sum of the squares of its digits; it is happy if this process eventually reaches 1 (rather than looping forever).","reference_solution":"def solve(n):\n seen = set()\n while n != 1 and n not in seen:\n seen.add(n)\n n = sum(int(d)**2 for d in str(n))\n return n == 1\n"}} {"submissionId":"cmszn1kts003owvp28ibmvaop","title":"Submission BMVAOP","payload":{"test_cases":[{"input":["0110"],"output":2},{"input":["0000"],"output":0},{"input":["0101"],"output":3},{"input":["1"],"output":0}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a binary string (containing only '0' and '1'), count the number of positions where an adjacent pair of characters differs (i.e., the number of transitions).","reference_solution":"def solve(s):\n return sum(1 for i in range(1, len(s)) if s[i] != s[i-1])\n"}} {"submissionId":"cmszn1kts003pwvp2j3n19trk","title":"Submission N19TRK","payload":{"test_cases":[{"input":["the cat sat on the mat","the"],"output":2},{"input":["a a a b","a"],"output":3},{"input":["hello world","world"],"output":1},{"input":["Cat cat CAT","cat"],"output":1}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence of space-separated words and a target word, count how many times the target word appears as a whole word in the sentence (case-sensitive).","reference_solution":"def solve(sentence, word):\n return sentence.split().count(word)\n"}} {"submissionId":"cmszn1kts003qwvp2qoh9dv6n","title":"Submission H9DV6N","payload":{"test_cases":[{"input":[[1,2,2,3,2]],"output":3},{"input":[[1,2,3]],"output":1},{"input":[[7,7,7,7]],"output":4},{"input":[[5]],"output":1}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a non-empty array of integers, return the highest number of times any single value occurs in the array.","reference_solution":"def solve(nums):\n from collections import Counter\n cnt = Counter(nums)\n return max(cnt.values())\n"}} {"submissionId":"cmszn1kts003rwvp2ggalkwiq","title":"Submission ALKWIQ","payload":{"test_cases":[{"input":[[true,false,true]],"output":2},{"input":[[false,false]],"output":0},{"input":[[true]],"output":1},{"input":[[true,true,true,false]],"output":3}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a list of boolean values, count how many of them are True.","reference_solution":"def solve(bools):\n return sum(1 for b in bools if b)\n"}} {"submissionId":"cmt126v1s00baeap23c78n48t","title":"Submission 78N48T","payload":{"test_cases":[{"input":[[1,-2,3,4]],"output":3},{"input":[[-1,-2]],"output":0},{"input":[[0,0,1]],"output":1},{"input":[[5]],"output":1}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, count how many elements are strictly positive.","reference_solution":"def solve(nums):\n return sum(1 for n in nums if n > 0)\n"}} {"submissionId":"cmt126v1s00bbeap2k2imtyr1","title":"Submission IMTYR1","payload":{"test_cases":[{"input":["the sky is blue"],"output":"blue is sky the"},{"input":["hello world"],"output":"world hello"},{"input":["a b c"],"output":"c b a"},{"input":["single"],"output":"single"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence of space-separated words, return a new sentence with the words in reverse order (single spaces between words).","reference_solution":"def solve(sentence):\n return \" \".join(sentence.split()[::-1])\n"}} {"submissionId":"cmt126v1s00bceap2uwvym6r7","title":"Submission VYM6R7","payload":{"test_cases":[{"input":[1,10],"output":4},{"input":[10,20],"output":4},{"input":[2,2],"output":1},{"input":[14,16],"output":0}],"constraints":"1 <= a <= b <= 10^5","time_limit_ms":1000,"problem_statement":"Given two integers a and b (a <= b), count how many prime numbers exist in the inclusive range [a, b].","reference_solution":"def solve(a, b):\n def is_prime(n):\n if n < 2:\n return False\n i = 2\n while i*i <= n:\n if n % i == 0:\n return False\n i += 1\n return True\n return sum(1 for n in range(a, b+1) if is_prime(n))\n"}} {"submissionId":"cmt126v1s00bdeap22q6guuas","title":"Submission 6GUUAS","payload":{"test_cases":[{"input":[38],"output":2},{"input":[9875],"output":2},{"input":[0],"output":0},{"input":[5],"output":5}],"constraints":"0 <= n <= 10^18","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, repeatedly sum its digits until a single digit remains, and return that digit (the digital root).","reference_solution":"def solve(n):\n while n >= 10:\n n = sum(int(d) for d in str(n))\n return n\n"}} {"submissionId":"cmt126v1s00beeap2d7plnbgu","title":"Submission PLNBGU","payload":{"test_cases":[{"input":["the quick brown fox"],"output":"quick"},{"input":["a bb ccc"],"output":"ccc"},{"input":["hello"],"output":"hello"},{"input":["cat elephant dog"],"output":"elephant"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a sentence of space-separated words, return the longest word (if there is a tie, return the first one that achieves the maximum length).","reference_solution":"def solve(sentence):\n words = sentence.split()\n return max(words, key=len)\n"}} {"submissionId":"cmt126v1s00bfeap29lr7n8vp","title":"Submission R7N8VP","payload":{"test_cases":[{"input":["abababab","ab"],"output":4},{"input":["aaaa","aa"],"output":2},{"input":["hello","x"],"output":0},{"input":["banana","ana"],"output":1}],"constraints":"1 <= len(s), len(sub) <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string s and a non-empty string sub, count the number of non-overlapping occurrences of sub in s.","reference_solution":"def solve(s, sub):\n count = 0\n start = 0\n while True:\n idx = s.find(sub, start)\n if idx == -1:\n break\n count += 1\n start = idx + len(sub)\n return count\n"}} {"submissionId":"cmt126v1s00bgeap2sujx9bbu","title":"Submission JX9BBU","payload":{"test_cases":[{"input":[[1,2,3]],"output":true},{"input":[[1,1,2]],"output":false},{"input":[[5]],"output":true},{"input":[[3,2,1]],"output":false}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers, determine whether it is strictly increasing (each element is greater than the previous one).","reference_solution":"def solve(nums):\n return all(nums[i] < nums[i+1] for i in range(len(nums)-1))\n"}} {"submissionId":"cmt126v1t00bheap2fr7aptwm","title":"Submission 7APTWM","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[3,7]},{"input":[[[5]]],"output":[5]},{"input":[[[1,1,1],[2,2,2]]],"output":[3,6]},{"input":[[[0,0],[0,0]]],"output":[0,0]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":1000,"problem_statement":"Given a 2D array (list of lists) of integers, return a list containing the sum of each row.","reference_solution":"def solve(matrix):\n return [sum(row) for row in matrix]\n"}} {"submissionId":"cmt126v1t00bieap2sfbzbfrb","title":"Submission BZBFRB","payload":{"test_cases":[{"input":[[[1,2],[3,4]]],"output":[4,6]},{"input":[[[5]]],"output":[5]},{"input":[[[1,1],[2,2],[3,3]]],"output":[6,6]},{"input":[[[0,0],[0,0]]],"output":[0,0]}],"constraints":"1 <= rows, cols <= 100","time_limit_ms":1000,"problem_statement":"Given a 2D array (list of lists) of integers representing a matrix, return a list containing the sum of each column.","reference_solution":"def solve(matrix):\n return [sum(col) for col in zip(*matrix)]\n"}} {"submissionId":"cmt126v1t00bjeap2k71d54q5","title":"Submission 1D54Q5","payload":{"test_cases":[{"input":[121],"output":true},{"input":[123],"output":false},{"input":[0],"output":true},{"input":[12321],"output":true}],"constraints":"0 <= n <= 10^18","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, determine whether it is a palindrome when written in decimal (reads the same forwards and backwards).","reference_solution":"def solve(n):\n s = str(n)\n return s == s[::-1]\n"}} {"submissionId":"cmt126v1t00bkeap21b72gxup","title":"Submission 72GXUP","payload":{"test_cases":[{"input":[1,10,3],"output":3},{"input":[5,5,5],"output":1},{"input":[1,100,10],"output":10},{"input":[10,20,7],"output":1}],"constraints":"1 <= a <= b <= 10^6, 1 <= k <= 10^6","time_limit_ms":1000,"problem_statement":"Given integers a and b (a <= b) and a positive integer k, count how many multiples of k lie in the inclusive range [a, b].","reference_solution":"def solve(a, b, k):\n return len([x for x in range(a, b+1) if x % k == 0])\n"}} {"submissionId":"cmt126v1t00bleap21p13i5u1","title":"Submission 13I5U1","payload":{"test_cases":[{"input":[[1,5,3,5]],"output":1},{"input":[[7]],"output":0},{"input":[[-1,-5,-3]],"output":0},{"input":[[2,2,2]],"output":0}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given a non-empty array of integers, return the index of the first occurrence of the maximum element.","reference_solution":"def solve(nums):\n max_val = max(nums)\n return nums.index(max_val)\n"}} {"submissionId":"cmt126v1t00bmeap27culiwxn","title":"Submission ULIWXN","payload":{"test_cases":[{"input":[[1,2,3,4],[2,3]],"output":true},{"input":[[1,2,3],[3,1]],"output":false},{"input":[[5,5,5],[5,5]],"output":true},{"input":[[1],[1]],"output":true}],"constraints":"1 <= len(sub) <= len(nums) <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers nums and another array sub, determine whether sub appears as a contiguous subarray within nums.","reference_solution":"def solve(nums, sub):\n n, m = len(nums), len(sub)\n for i in range(n - m + 1):\n if nums[i:i+m] == sub:\n return True\n return False\n"}} {"submissionId":"cmt126v1t00bneap258v5i120","title":"Submission V5I120","payload":{"test_cases":[{"input":[[3,2,2,3],2],"output":[3,3]},{"input":[[1,1,1],1],"output":[]},{"input":[[1,2,3],5],"output":[1,2,3]},{"input":[[4,4,4,4],4],"output":[]}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers and a value val, return a new array with all occurrences of val removed, preserving the order of remaining elements.","reference_solution":"def solve(nums, val):\n return [n for n in nums if n != val]\n"}} {"submissionId":"cmt126v1t00boeap2wmwtlkgw","title":"Submission WTLKGW","payload":{"test_cases":[{"input":["aabbbcc"],"output":"b"},{"input":["xyz"],"output":"x"},{"input":["aaa"],"output":"a"},{"input":["bbaacc"],"output":"b"}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a non-empty string, return the character that occurs most frequently. If there is a tie, return the one that appears first in the string among the tied characters.","reference_solution":"def solve(s):\n from collections import Counter\n cnt = Counter(s)\n max_count = max(cnt.values())\n for c in s:\n if cnt[c] == max_count:\n return c\n"}} {"submissionId":"cmt126v1t00bpeap2e9ky80t3","title":"Submission KY80T3","payload":{"test_cases":[{"input":["()[]{}"],"output":true},{"input":["(]"],"output":false},{"input":["([{}])"],"output":true},{"input":["([)]"],"output":false}],"constraints":"1 <= length <= 10^5","time_limit_ms":1000,"problem_statement":"Given a string containing only the bracket characters (), [], and {}, determine whether the brackets are validly matched and nested.","reference_solution":"def solve(s):\n pairs = {')': '(', ']': '[', '}': '{'}\n stack = []\n for c in s:\n if c in \"([{\":\n stack.append(c)\n elif c in \")]}\":\n if not stack or stack.pop() != pairs[c]:\n return False\n return not stack\n"}} {"submissionId":"cmt126v1t00bqeap2q0csbr4o","title":"Submission CSBR4O","payload":{"test_cases":[{"input":[[1,3,2,5]],"output":6},{"input":[[5,5,5]],"output":0},{"input":[[1,10]],"output":9},{"input":[[0,-5,5]],"output":15}],"constraints":"2 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers with at least two elements, return the sum of the absolute differences between each pair of consecutive elements.","reference_solution":"def solve(nums):\n return sum(abs(nums[i] - nums[i+1]) for i in range(len(nums)-1))\n"}} {"submissionId":"cmt126v1t00breap2z578mrzb","title":"Submission 78MRZB","payload":{"test_cases":[{"input":[27],"output":true},{"input":[10],"output":false},{"input":[0],"output":true},{"input":[1000],"output":true}],"constraints":"0 <= n <= 10^12","time_limit_ms":1000,"problem_statement":"Given a non-negative integer n, determine whether it is a perfect cube.","reference_solution":"def solve(n):\n if n < 0:\n return False\n r = round(n ** (1/3))\n for candidate in (r-1, r, r+1):\n if candidate ** 3 == n:\n return True\n return False\n"}} {"submissionId":"cmt126v1t00bseap2ts2swzsq","title":"Submission 2SWZSQ","payload":{"test_cases":[{"input":[[1,5,10,15],3,12],"output":2},{"input":[[1,2,3],10,20],"output":0},{"input":[[5,5,5],5,5],"output":3},{"input":[[-5,0,5],-10,0],"output":2}],"constraints":"1 <= n <= 10^5","time_limit_ms":1000,"problem_statement":"Given an array of integers and two integers low and high (low <= high), count how many elements fall within the inclusive range [low, high].","reference_solution":"def solve(nums, low, high):\n return sum(1 for n in nums if low <= n <= high)\n"}} {"submissionId":"cmt126v1t00bteap20vq54n7y","title":"Submission Q54N7Y","payload":{"test_cases":[{"input":["a"],"output":true},{"input":["b"],"output":false},{"input":["E"],"output":true},{"input":["z"],"output":false}],"constraints":"length == 1","time_limit_ms":1000,"problem_statement":"Given a single alphabetic character, determine whether it is a vowel (a, e, i, o, u), case-insensitive.","reference_solution":"def solve(c):\n return c.lower() in \"aeiou\"\n"}} {"submissionId":"cmt2w02an000bqup2fo6z1jp7","title":"Submission 6Z1JP7","payload":{"test_cases":[{"input":["Hello"],"output":2},{"input":["AEIOU"],"output":5},{"input":["rhythm"],"output":0}],"constraints":"0 <= length <= 10^4","time_limit_ms":500,"problem_statement":"Given a string, count how many vowels (a,e,i,o,u) it contains, case-insensitively.","reference_solution":"def solve(s):\n return sum(c.lower() in 'aeiou' for c in s)\n"}} {"submissionId":"cmt2w02ao000cqup2038b86ps","title":"Submission 8B86PS","payload":{"test_cases":[{"input":[[3,1,9,2]],"output":9},{"input":[[-5,-2,-8]],"output":-2},{"input":[[7]],"output":7}],"constraints":"1 <= n <= 1000, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return its maximum value.","reference_solution":"def solve(nums):\n return max(nums)\n"}} {"submissionId":"cmt2w02ao000dqup2s6q19wnj","title":"Submission Q19WNJ","payload":{"test_cases":[{"input":[0],"output":1},{"input":[5],"output":120},{"input":[7],"output":5040}],"constraints":"0 <= n <= 12","time_limit_ms":500,"problem_statement":"Given an integer n >= 0, return n factorial.","reference_solution":"def solve(n):\n ans = 1\n for i in range(2, n+1):\n ans *= i\n return ans\n"}} {"submissionId":"cmt2w02ao000equp2jlm9rn1n","title":"Submission M9RN1N","payload":{"test_cases":[{"input":[[1,2,3]],"output":[3,2,1]},{"input":[[]],"output":[]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 1000","time_limit_ms":500,"problem_statement":"Given a list of integers, return a new list containing the values in reverse order.","reference_solution":"def solve(nums):\n return nums[::-1]\n"}} {"submissionId":"cmt2w02ao000fqup2uhybpqi4","title":"Submission YBPQI4","payload":{"test_cases":[{"input":[18,24],"output":6},{"input":[-21,14],"output":7},{"input":[7,3],"output":1}],"constraints":"-10^9 <= a,b <= 10^9, not both zero","time_limit_ms":500,"problem_statement":"Given two integers a and b, return their greatest common divisor as a non-negative integer.","reference_solution":"def solve(a, b):\n a, b = abs(a), abs(b)\n while b:\n a, b = b, a % b\n return a\n"}} {"submissionId":"cmt2w02ao000gqup26zaer1g4","title":"Submission AER1G4","payload":{"test_cases":[{"input":["level"],"output":true},{"input":["abc"],"output":false},{"input":[""],"output":true}],"constraints":"0 <= length <= 10^4","time_limit_ms":500,"problem_statement":"Given a string, return True if it reads the same forward and backward, otherwise False.","reference_solution":"def solve(s):\n return s == s[::-1]\n"}} {"submissionId":"cmt2w02ao000hqup2to7v8y08","title":"Submission 7V8Y08","payload":{"test_cases":[{"input":[[1,2,2,3],2],"output":2},{"input":[[],5],"output":0},{"input":[[7,7,7],7],"output":3}],"constraints":"0 <= n <= 10^4, -10^9 <= target,value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of integers and a target, return how many times the target occurs.","reference_solution":"def solve(nums, target):\n return sum(1 for x in nums if x == target)\n"}} {"submissionId":"cmt2w02ao000iqup2z0ax011y","title":"Submission AX011Y","payload":{"test_cases":[{"input":[1],"output":1},{"input":[5],"output":15},{"input":[100],"output":5050}],"constraints":"1 <= n <= 10^6","time_limit_ms":500,"problem_statement":"Given a positive integer n, return the sum of integers from 1 through n inclusive.","reference_solution":"def solve(n):\n return n * (n + 1) // 2\n"}} {"submissionId":"cmt2w02ao000jqup25atakm93","title":"Submission TAKM93","payload":{"test_cases":[{"input":[[-1,0,2,3]],"output":2},{"input":[[0,0]],"output":0},{"input":[[1,2,3]],"output":3}],"constraints":"0 <= n <= 10^4, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Given a list of numbers, return the number of values that are strictly greater than zero.","reference_solution":"def solve(nums):\n return sum(x > 0 for x in nums)\n"}} {"submissionId":"cmt84wht801eqqup2t8m2bj0v","title":"Submission M2BJ0V","payload":{"test_cases":[{"input":["UUD"],"output":1},{"input":["DDD"],"output":0},{"input":["UDUDUD"],"output":0},{"input":["UUUU"],"output":4}],"constraints":"1 <= len(moves) <= 10^5, moves contains only 'U' and 'D'.","time_limit_ms":500,"problem_statement":"An elevator starts at floor 0. You are given a string of moves where 'U' goes up one floor and 'D' goes down one floor, but the elevator can never go below floor 0 (a 'D' at floor 0 is ignored). Return the final floor after applying all moves in order.","reference_solution":"def solve(moves):\n floor = 0\n for c in moves:\n if c == 'U':\n floor += 1\n elif c == 'D':\n floor = max(0, floor - 1)\n return floor\n"}} {"submissionId":"cmt84wht801erqup2hx2z405t","title":"Submission 2Z405T","payload":{"test_cases":[{"input":[[10,20,30,40,50]],"output":20},{"input":[[95,5,5,5,5]],"output":9},{"input":[[]],"output":0},{"input":[[9]],"output":0}],"constraints":"0 <= len(amounts) <= 10^4, 0 <= amount <= 10^6.","time_limit_ms":500,"problem_statement":"A shop awards loyalty points for each purchase equal to the purchase amount divided by 10 (integer division). As a promotion, every 5th purchase (the 5th, 10th, 15th, ...) awards double points. Given the list of purchase amounts in order, return the total number of loyalty points earned.","reference_solution":"def solve(amounts):\n total = 0\n for i, a in enumerate(amounts):\n p = a // 10\n if (i + 1) % 5 == 0:\n p *= 2\n total += p\n return total\n"}} {"submissionId":"cmt84wht801esqup2djiny5gp","title":"Submission INY5GP","payload":{"test_cases":[{"input":[[3,0,5],4],"output":[1,4,0]},{"input":[[10,10],5],"output":[0,0]},{"input":[[],7],"output":[]},{"input":[[0],0],"output":[0]}],"constraints":"0 <= len(stock) <= 10^5, 0 <= stock[i] <= 10^9, 0 <= min_level <= 10^9.","time_limit_ms":500,"problem_statement":"A warehouse wants every product restocked to a minimum level. Given a list of current stock counts and an integer min_level, return a list of the quantities to add to each product so it reaches min_level. A product already at or above min_level needs 0.","reference_solution":"def solve(stock, min_level):\n return [max(0, min_level - x) for x in stock]\n"}} {"submissionId":"cmt84wht801etqup23ycu6xjn","title":"Submission CU6XJN","payload":{"test_cases":[{"input":[0],"output":"green"},{"input":[30],"output":"yellow"},{"input":[35],"output":"red"},{"input":[125],"output":"green"}],"constraints":"0 <= seconds <= 10^9.","time_limit_ms":500,"problem_statement":"A traffic light repeats a 60-second cycle: it is green for the first 30 seconds, yellow for the next 5 seconds, and red for the remaining 25 seconds. Given a non-negative integer number of seconds since a cycle began (which may be larger than 60), return the light's color as the string 'green', 'yellow', or 'red'.","reference_solution":"def solve(seconds):\n t = seconds % 60\n if t < 30:\n return 'green'\n if t < 35:\n return 'yellow'\n return 'red'\n"}} {"submissionId":"cmt84wht801euqup218flunuf","title":"Submission FLUNUF","payload":{"test_cases":[{"input":[[3,2,-1,4],5],"output":true},{"input":[[1,-1,1,-1],1],"output":false},{"input":[[6],5],"output":true},{"input":[[5],5],"output":false}],"constraints":"0 <= len(events) <= 10^5, -10^4 <= events[i] <= 10^4, 0 <= capacity <= 10^9.","time_limit_ms":500,"problem_statement":"A conference room starts empty. You are given a list of integer events applied in order, where a positive value is that many people entering and a negative value is that many leaving, plus an integer capacity. Return True if the number of people in the room ever exceeds capacity at any point, otherwise False.","reference_solution":"def solve(events, capacity):\n cur = 0\n for e in events:\n cur += e\n if cur > capacity:\n return True\n return False\n"}} {"submissionId":"cmt84wht801evqup2s7x4guoz","title":"Submission X4GUOZ","payload":{"test_cases":[{"input":[39],"output":3},{"input":[10],"output":1},{"input":[7],"output":0},{"input":[999],"output":4}],"constraints":"0 <= n <= 10^9.","time_limit_ms":500,"problem_statement":"Define one round on a positive integer as replacing it with the product of its decimal digits. Starting from n, repeat rounds until the value becomes a single digit (less than 10). Return the number of rounds required.","reference_solution":"def solve(n):\n steps = 0\n while n >= 10:\n p = 1\n for d in str(n):\n p *= int(d)\n n = p\n steps += 1\n return steps\n"}} {"submissionId":"cmt84wht801ewqup2agtxnrd1","title":"Submission TXNRD1","payload":{"test_cases":[{"input":[[1,2,5,1,1,1,9],3],"output":3},{"input":[[5,5,5],3],"output":0},{"input":[[1,1,1,1],3],"output":4},{"input":[[],3],"output":0}],"constraints":"0 <= len(levels) <= 10^5, 0 <= levels[i] <= 10^9, 0 <= threshold <= 10^9.","time_limit_ms":500,"problem_statement":"A sensor logs noise levels once per minute. A 'quiet period' is a maximal run of consecutive readings that are all less than or equal to a given threshold. Given the list of readings and the integer threshold, return the length of the longest quiet period (0 if there is none).","reference_solution":"def solve(levels, threshold):\n best = cur = 0\n for x in levels:\n if x <= threshold:\n cur += 1\n if cur > best:\n best = cur\n else:\n cur = 0\n return best\n"}} {"submissionId":"cmt84wht801exqup2nk2d2svw","title":"Submission 2D2SVW","payload":{"test_cases":[{"input":[[0,3,5,-1,2],3],"output":3},{"input":[[10,20],5],"output":0},{"input":[[-1,-2],5],"output":0},{"input":[[0],0],"output":1}],"constraints":"0 <= len(days_left) <= 10^5, -10^9 <= days_left[i] <= 10^9, 0 <= d <= 10^9.","time_limit_ms":500,"problem_statement":"Given a list of integers where each value is the number of days left before a coupon expires, and an integer d, return how many coupons expire within the next d days. A coupon counts if its days-left value is between 0 and d inclusive; already-expired coupons (negative values) do not count.","reference_solution":"def solve(days_left, d):\n return sum(1 for x in days_left if 0 <= x <= d)\n"}} {"submissionId":"cmt84wht801eyqup2ilbufxdh","title":"Submission BUFXDH","payload":{"test_cases":[{"input":[[20,21,25,26],3],"output":2},{"input":[[20,20,20],1],"output":-1},{"input":[[1,2,3,10],5],"output":3},{"input":[[5],3],"output":-1}],"constraints":"1 <= len(temps) <= 10^5, -10^4 <= temps[i] <= 10^4, 0 <= delta <= 10^9.","time_limit_ms":500,"problem_statement":"A weather station records hourly temperatures. Given the list of temperatures and an integer delta, return the index of the first hour whose temperature differs from the previous hour by strictly more than delta (absolute difference). Return -1 if no such hour exists.","reference_solution":"def solve(temps, delta):\n for i in range(1, len(temps)):\n if abs(temps[i] - temps[i - 1]) > delta:\n return i\n return -1\n"}} {"submissionId":"cmt84wht801ezqup2as1ou51n","title":"Submission 1OU51N","payload":{"test_cases":[{"input":[0,0],"output":"white"},{"input":[0,1],"output":"black"},{"input":[1,1],"output":"white"},{"input":[7,7],"output":"white"}],"constraints":"0 <= row <= 10^9, 0 <= col <= 10^9.","time_limit_ms":500,"problem_statement":"On a standard chessboard the square at row 0, column 0 is white and colors alternate. Given two 0-indexed integers row and col, return the color of that square as 'white' or 'black'.","reference_solution":"def solve(row, col):\n return 'white' if (row + col) % 2 == 0 else 'black'\n"}} {"submissionId":"cmt84wht801f0qup2di4azwqc","title":"Submission 4AZWQC","payload":{"test_cases":[{"input":[[1,-2,3]],"output":0},{"input":[[-1,-1]],"output":-4},{"input":[[5,5]],"output":10},{"input":[[]],"output":0}],"constraints":"0 <= len(values) <= 10^5, -10^4 <= values[i] <= 10^4.","time_limit_ms":500,"problem_statement":"A score sheet contains a list of integers. Positive and zero values are added at face value, but each negative value is treated as a penalty and counts for twice its value. Return the resulting total.","reference_solution":"def solve(values):\n return sum(v * 2 if v < 0 else v for v in values)\n"}} {"submissionId":"cmt84wht801f1qup2ye6x5ell","title":"Submission 6X5ELL","payload":{"test_cases":[{"input":[12345],"output":3},{"input":[0],"output":0},{"input":[1010],"output":2},{"input":[246],"output":4}],"constraints":"0 <= n <= 10^18.","time_limit_ms":500,"problem_statement":"Given a non-negative integer n, compute the alternating sum of its decimal digits from left to right: add the first digit, subtract the second, add the third, and so on. Return the resulting integer.","reference_solution":"def solve(n):\n total = 0\n sign = 1\n for d in str(n):\n total += sign * int(d)\n sign *= -1\n return total\n"}} {"submissionId":"cmt84wht801f2qup2t9af7au1","title":"Submission AF7AU1","payload":{"test_cases":[{"input":["hello"],"output":-1},{"input":["AEIOU"],"output":5},{"input":["a1b2"],"output":0},{"input":[""],"output":0}],"constraints":"0 <= len(text) <= 10^5.","time_limit_ms":500,"problem_statement":"Given a string, count its alphabetic characters and return the number of vowels minus the number of consonants. Vowels are a, e, i, o, u in either case; every other letter is a consonant. Non-letter characters are ignored.","reference_solution":"def solve(text):\n vowels = set('aeiouAEIOU')\n v = c = 0\n for ch in text:\n if ch.isalpha():\n if ch in vowels:\n v += 1\n else:\n c += 1\n return v - c\n"}} {"submissionId":"cmt84wht801f3qup23hlpa3ad","title":"Submission LPA3AD","payload":{"test_cases":[{"input":[50],"output":50},{"input":[100],"output":90},{"input":[499],"output":450},{"input":[500],"output":400}],"constraints":"0 <= amount <= 10^9.","time_limit_ms":500,"problem_statement":"A store applies tiered discounts to an order total: orders below 100 get no discount, orders from 100 to 499 inclusive get 10% off, and orders of 500 or more get 20% off. Given an integer order amount, return the final price after discount, using integer arithmetic (discount rounded down).","reference_solution":"def solve(amount):\n if amount < 100:\n rate = 0\n elif amount < 500:\n rate = 10\n else:\n rate = 20\n return amount - amount * rate // 100\n"}} {"submissionId":"cmt84wht801f4qup22fqq0kf7","title":"Submission QQ0KF7","payload":{"test_cases":[{"input":[[1,2,2,3,3]],"output":2},{"input":[[4,4,4,1]],"output":4},{"input":[[5]],"output":5},{"input":[[9,8,8,9]],"output":8}],"constraints":"1 <= len(nums) <= 10^5, -10^9 <= nums[i] <= 10^9.","time_limit_ms":500,"problem_statement":"Given a non-empty list of integers, return the value that appears most frequently. If two or more values are tied for the highest frequency, return the smallest of those tied values.","reference_solution":"def solve(nums):\n from collections import Counter\n counts = Counter(nums)\n best = max(counts.values())\n return min(k for k, v in counts.items() if v == best)\n"}} {"submissionId":"cmt84wht801f5qup2sar4uo2n","title":"Submission R4UO2N","payload":{"test_cases":[{"input":[10,3,1],"output":5},{"input":[10,1,1],"output":-1},{"input":[7,3,1],"output":4},{"input":[5,10,2],"output":1}],"constraints":"1 <= C <= 10^9, 0 <= rate <= 10^9, 0 <= leak <= 10^9.","time_limit_ms":500,"problem_statement":"A tank starts empty and must reach a capacity of C liters. Each minute a pump adds `rate` liters while `leak` liters drain away, giving a net change of rate minus leak per minute. Return the smallest whole number of minutes after which the tank holds at least C liters, or -1 if it can never reach C.","reference_solution":"def solve(C, rate, leak):\n net = rate - leak\n if net <= 0:\n return -1\n return (C + net - 1) // net\n"}} {"submissionId":"cmtcr6x9f002il3p2535crji9","title":"Submission 5CRJI9","payload":{"test_cases":[{"input":[[-7,-6,-5,-3]],"output":2},{"input":[[]],"output":0},{"input":[[-1,0]],"output":2},{"input":[[-11,-6]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of sensor readings, count how many values are strictly greater than -6.","reference_solution":"def solve(nums):\n # sensor_readings_gt_-6\n return sum(1 for x in nums if x > -6)\n"}} {"submissionId":"cmtcr6x9f002jl3p2qra6ulnl","title":"Submission A6ULNL","payload":{"test_cases":[{"input":[[3,4,6,-3]],"output":[3,6,-3]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[3]},{"input":[[0,9]],"output":[0,9]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of sensor readings, return only the values divisible by 3, preserving their original order.","reference_solution":"def solve(nums):\n # sensor_readings_divisible_3\n return [x for x in nums if x % 3 == 0]\n"}} {"submissionId":"cmtcr6x9f002kl3p2ry19mf9e","title":"Submission 19MF9E","payload":{"test_cases":[{"input":[[-6,-5,-4,-2]],"output":2},{"input":[[]],"output":0},{"input":[[0,1]],"output":2},{"input":[[-10,-5]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of warehouse counts, count how many values are strictly greater than -5.","reference_solution":"def solve(nums):\n # warehouse_counts_gt_-5\n return sum(1 for x in nums if x > -5)\n"}} {"submissionId":"cmtcr6x9f002ll3p2i97tf9x0","title":"Submission 7TF9X0","payload":{"test_cases":[{"input":[[4,5,8,-4]],"output":[4,8,-4]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,12]],"output":[0,12]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of warehouse counts, return only the values divisible by 4, preserving their original order.","reference_solution":"def solve(nums):\n # warehouse_counts_divisible_4\n return [x for x in nums if x % 4 == 0]\n"}} {"submissionId":"cmtcr6x9f002ml3p2vywjsnyq","title":"Submission WJSNYQ","payload":{"test_cases":[{"input":[[-5,-4,-3,-1]],"output":2},{"input":[[]],"output":0},{"input":[[1,2]],"output":2},{"input":[[-9,-4]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of daily temperatures, count how many values are strictly greater than -4.","reference_solution":"def solve(nums):\n # daily_temperatures_gt_-4\n return sum(1 for x in nums if x > -4)\n"}} {"submissionId":"cmtcr6x9f002nl3p2y4fdljn5","title":"Submission FDLJN5","payload":{"test_cases":[{"input":[[5,6,10,-5]],"output":[5,10,-5]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,15]],"output":[0,15]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of daily temperatures, return only the values divisible by 5, preserving their original order.","reference_solution":"def solve(nums):\n # daily_temperatures_divisible_5\n return [x for x in nums if x % 5 == 0]\n"}} {"submissionId":"cmtcr6x9f002ol3p2v2fyctv5","title":"Submission FYCTV5","payload":{"test_cases":[{"input":[[-4,-3,-2,0]],"output":2},{"input":[[]],"output":0},{"input":[[2,3]],"output":2},{"input":[[-8,-3]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of scoreboard values, count how many values are strictly greater than -3.","reference_solution":"def solve(nums):\n # scoreboard_values_gt_-3\n return sum(1 for x in nums if x > -3)\n"}} {"submissionId":"cmtcr6x9f002pl3p2d89wkha2","title":"Submission 9WKHA2","payload":{"test_cases":[{"input":[[6,7,12,-6]],"output":[6,12,-6]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,18]],"output":[0,18]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of scoreboard values, return only the values divisible by 6, preserving their original order.","reference_solution":"def solve(nums):\n # scoreboard_values_divisible_6\n return [x for x in nums if x % 6 == 0]\n"}} {"submissionId":"cmtcr6x9f002ql3p2vpb0w782","title":"Submission B0W782","payload":{"test_cases":[{"input":[[-3,-2,-1,1]],"output":2},{"input":[[]],"output":0},{"input":[[3,4]],"output":2},{"input":[[-7,-2]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of transaction amounts, count how many values are strictly greater than -2.","reference_solution":"def solve(nums):\n # transaction_amounts_gt_-2\n return sum(1 for x in nums if x > -2)\n"}} {"submissionId":"cmtcr6x9g002rl3p2uy5kq5kg","title":"Submission 5KQ5KG","payload":{"test_cases":[{"input":[[7,8,14,-7]],"output":[7,14,-7]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,21]],"output":[0,21]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of transaction amounts, return only the values divisible by 7, preserving their original order.","reference_solution":"def solve(nums):\n # transaction_amounts_divisible_7\n return [x for x in nums if x % 7 == 0]\n"}} {"submissionId":"cmtcr6x9g002sl3p2b8ql38ya","title":"Submission QL38YA","payload":{"test_cases":[{"input":[[-2,-1,0,2]],"output":2},{"input":[[]],"output":0},{"input":[[4,5]],"output":2},{"input":[[-6,-1]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of queue lengths, count how many values are strictly greater than -1.","reference_solution":"def solve(nums):\n # queue_lengths_gt_-1\n return sum(1 for x in nums if x > -1)\n"}} {"submissionId":"cmtcr6x9g002tl3p2wm4u9kkw","title":"Submission 4U9KKW","payload":{"test_cases":[{"input":[[8,9,16,-8]],"output":[8,16,-8]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,24]],"output":[0,24]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of queue lengths, return only the values divisible by 8, preserving their original order.","reference_solution":"def solve(nums):\n # queue_lengths_divisible_8\n return [x for x in nums if x % 8 == 0]\n"}} {"submissionId":"cmtcr6x9g002ul3p2wtya4a44","title":"Submission YA4A44","payload":{"test_cases":[{"input":[[-1,0,1,3]],"output":2},{"input":[[]],"output":0},{"input":[[5,6]],"output":2},{"input":[[-5,0]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of packet sizes, count how many values are strictly greater than 0.","reference_solution":"def solve(nums):\n # packet_sizes_gt_0\n return sum(1 for x in nums if x > 0)\n"}} {"submissionId":"cmtcr6x9g002vl3p2y35hp8lr","title":"Submission 5HP8LR","payload":{"test_cases":[{"input":[[2,3,4,-2]],"output":[2,4,-2]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[2]},{"input":[[0,6]],"output":[0,6]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of packet sizes, return only the values divisible by 2, preserving their original order.","reference_solution":"def solve(nums):\n # packet_sizes_divisible_2\n return [x for x in nums if x % 2 == 0]\n"}} {"submissionId":"cmtcr6x9g002wl3p2j776mshi","title":"Submission 76MSHI","payload":{"test_cases":[{"input":[[0,1,2,4]],"output":2},{"input":[[]],"output":0},{"input":[[6,7]],"output":2},{"input":[[-4,1]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of inventory levels, count how many values are strictly greater than 1.","reference_solution":"def solve(nums):\n # inventory_levels_gt_1\n return sum(1 for x in nums if x > 1)\n"}} {"submissionId":"cmtcr6x9g002xl3p2urgjkc4q","title":"Submission GJKC4Q","payload":{"test_cases":[{"input":[[3,4,6,-3]],"output":[3,6,-3]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[3]},{"input":[[0,9]],"output":[0,9]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of inventory levels, return only the values divisible by 3, preserving their original order.","reference_solution":"def solve(nums):\n # inventory_levels_divisible_3\n return [x for x in nums if x % 3 == 0]\n"}} {"submissionId":"cmtcr6x9g002yl3p28o9ceehq","title":"Submission 9CEEHQ","payload":{"test_cases":[{"input":[[1,2,3,5]],"output":2},{"input":[[]],"output":0},{"input":[[7,8]],"output":2},{"input":[[-3,2]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of response times, count how many values are strictly greater than 2.","reference_solution":"def solve(nums):\n # response_times_gt_2\n return sum(1 for x in nums if x > 2)\n"}} {"submissionId":"cmtcr6x9g002zl3p204f72tag","title":"Submission F72TAG","payload":{"test_cases":[{"input":[[4,5,8,-4]],"output":[4,8,-4]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,12]],"output":[0,12]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of response times, return only the values divisible by 4, preserving their original order.","reference_solution":"def solve(nums):\n # response_times_divisible_4\n return [x for x in nums if x % 4 == 0]\n"}} {"submissionId":"cmtcr6x9g0030l3p22c3w1vrv","title":"Submission 3W1VRV","payload":{"test_cases":[{"input":[[2,3,4,6]],"output":2},{"input":[[]],"output":0},{"input":[[8,9]],"output":2},{"input":[[-2,3]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of energy readings, count how many values are strictly greater than 3.","reference_solution":"def solve(nums):\n # energy_readings_gt_3\n return sum(1 for x in nums if x > 3)\n"}} {"submissionId":"cmtcr6x9g0031l3p25nar0spr","title":"Submission AR0SPR","payload":{"test_cases":[{"input":[[5,6,10,-5]],"output":[5,10,-5]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,15]],"output":[0,15]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of energy readings, return only the values divisible by 5, preserving their original order.","reference_solution":"def solve(nums):\n # energy_readings_divisible_5\n return [x for x in nums if x % 5 == 0]\n"}} {"submissionId":"cmtcr6x9g0032l3p2hka5dyhc","title":"Submission A5DYHC","payload":{"test_cases":[{"input":[[3,4,5,7]],"output":2},{"input":[[]],"output":0},{"input":[[9,10]],"output":2},{"input":[[-1,4]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of vote totals, count how many values are strictly greater than 4.","reference_solution":"def solve(nums):\n # vote_totals_gt_4\n return sum(1 for x in nums if x > 4)\n"}} {"submissionId":"cmtcr6x9g0033l3p2pg81wvqj","title":"Submission 81WVQJ","payload":{"test_cases":[{"input":[[6,7,12,-6]],"output":[6,12,-6]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,18]],"output":[0,18]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of vote totals, return only the values divisible by 6, preserving their original order.","reference_solution":"def solve(nums):\n # vote_totals_divisible_6\n return [x for x in nums if x % 6 == 0]\n"}} {"submissionId":"cmtcr6x9g0034l3p2pts14xvj","title":"Submission S14XVJ","payload":{"test_cases":[{"input":[[4,5,6,8]],"output":2},{"input":[[]],"output":0},{"input":[[10,11]],"output":2},{"input":[[0,5]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of step counts, count how many values are strictly greater than 5.","reference_solution":"def solve(nums):\n # step_counts_gt_5\n return sum(1 for x in nums if x > 5)\n"}} {"submissionId":"cmtcr6x9g0035l3p2oelz6y53","title":"Submission LZ6Y53","payload":{"test_cases":[{"input":[[7,8,14,-7]],"output":[7,14,-7]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,21]],"output":[0,21]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of step counts, return only the values divisible by 7, preserving their original order.","reference_solution":"def solve(nums):\n # step_counts_divisible_7\n return [x for x in nums if x % 7 == 0]\n"}} {"submissionId":"cmtcr6x9g0036l3p2u5e6vnv3","title":"Submission E6VNV3","payload":{"test_cases":[{"input":[[5,6,7,9]],"output":2},{"input":[[]],"output":0},{"input":[[11,12]],"output":2},{"input":[[1,6]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of page-view counts, count how many values are strictly greater than 6.","reference_solution":"def solve(nums):\n # page-view_counts_gt_6\n return sum(1 for x in nums if x > 6)\n"}} {"submissionId":"cmtcr6x9g0037l3p25h5k9kak","title":"Submission 5K9KAK","payload":{"test_cases":[{"input":[[8,9,16,-8]],"output":[8,16,-8]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,24]],"output":[0,24]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of page-view counts, return only the values divisible by 8, preserving their original order.","reference_solution":"def solve(nums):\n # page-view_counts_divisible_8\n return [x for x in nums if x % 8 == 0]\n"}} {"submissionId":"cmtcr6x9g0038l3p23d6giecj","title":"Submission 6GIECJ","payload":{"test_cases":[{"input":[[6,7,8,10]],"output":2},{"input":[[]],"output":0},{"input":[[12,13]],"output":2},{"input":[[2,7]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of task durations, count how many values are strictly greater than 7.","reference_solution":"def solve(nums):\n # task_durations_gt_7\n return sum(1 for x in nums if x > 7)\n"}} {"submissionId":"cmtcr6x9g0039l3p2svkh2o1e","title":"Submission KH2O1E","payload":{"test_cases":[{"input":[[2,3,4,-2]],"output":[2,4,-2]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[2]},{"input":[[0,6]],"output":[0,6]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of task durations, return only the values divisible by 2, preserving their original order.","reference_solution":"def solve(nums):\n # task_durations_divisible_2\n return [x for x in nums if x % 2 == 0]\n"}} {"submissionId":"cmtcr6x9g003al3p2nw751kh6","title":"Submission 751KH6","payload":{"test_cases":[{"input":[[7,8,9,11]],"output":2},{"input":[[]],"output":0},{"input":[[13,14]],"output":2},{"input":[[3,8]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of altitude samples, count how many values are strictly greater than 8.","reference_solution":"def solve(nums):\n # altitude_samples_gt_8\n return sum(1 for x in nums if x > 8)\n"}} {"submissionId":"cmtcr6x9g003bl3p2dv2j971a","title":"Submission 2J971A","payload":{"test_cases":[{"input":[[3,4,6,-3]],"output":[3,6,-3]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[3]},{"input":[[0,9]],"output":[0,9]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of altitude samples, return only the values divisible by 3, preserving their original order.","reference_solution":"def solve(nums):\n # altitude_samples_divisible_3\n return [x for x in nums if x % 3 == 0]\n"}} {"submissionId":"cmtcr6x9g003cl3p2apg6brp6","title":"Submission G6BRP6","payload":{"test_cases":[{"input":[[8,9,10,12]],"output":2},{"input":[[]],"output":0},{"input":[[14,15]],"output":2},{"input":[[4,9]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of price changes, count how many values are strictly greater than 9.","reference_solution":"def solve(nums):\n # price_changes_gt_9\n return sum(1 for x in nums if x > 9)\n"}} {"submissionId":"cmtcr6x9g003dl3p2mb8ohl2r","title":"Submission 8OHL2R","payload":{"test_cases":[{"input":[[4,5,8,-4]],"output":[4,8,-4]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,12]],"output":[0,12]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of price changes, return only the values divisible by 4, preserving their original order.","reference_solution":"def solve(nums):\n # price_changes_divisible_4\n return [x for x in nums if x % 4 == 0]\n"}} {"submissionId":"cmtcr6x9g003el3p27h2pax7m","title":"Submission 2PAX7M","payload":{"test_cases":[{"input":[[9,10,11,13]],"output":2},{"input":[[]],"output":0},{"input":[[15,16]],"output":2},{"input":[[5,10]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of error counts, count how many values are strictly greater than 10.","reference_solution":"def solve(nums):\n # error_counts_gt_10\n return sum(1 for x in nums if x > 10)\n"}} {"submissionId":"cmtcr6x9g003fl3p2p09nstlv","title":"Submission 9NSTLV","payload":{"test_cases":[{"input":[[5,6,10,-5]],"output":[5,10,-5]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,15]],"output":[0,15]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of error counts, return only the values divisible by 5, preserving their original order.","reference_solution":"def solve(nums):\n # error_counts_divisible_5\n return [x for x in nums if x % 5 == 0]\n"}} {"submissionId":"cmtcr6x9g003gl3p2j5qit2y3","title":"Submission QIT2Y3","payload":{"test_cases":[{"input":[[10,11,12,14]],"output":2},{"input":[[]],"output":0},{"input":[[16,17]],"output":2},{"input":[[6,11]],"output":0}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of memory samples, count how many values are strictly greater than 11.","reference_solution":"def solve(nums):\n # memory_samples_gt_11\n return sum(1 for x in nums if x > 11)\n"}} {"submissionId":"cmtcr6x9g003hl3p246il530i","title":"Submission IL530I","payload":{"test_cases":[{"input":[[6,7,12,-6]],"output":[6,12,-6]},{"input":[[]],"output":[]},{"input":[[1,2,3]],"output":[]},{"input":[[0,18]],"output":[0,18]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of memory samples, return only the values divisible by 6, preserving their original order.","reference_solution":"def solve(nums):\n # memory_samples_divisible_6\n return [x for x in nums if x % 6 == 0]\n"}} {"submissionId":"cmtcr6x9g003il3p2sccwshui","title":"Submission CWSHUI","payload":{"test_cases":[{"input":["bbbabc"],"output":4},{"input":[""],"output":0},{"input":["abcabc"],"output":2},{"input":["b"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'b' appears in the label for the sensor readings case.","reference_solution":"def solve(s):\n # label_count_1_b\n return s.count('b')\n"}} {"submissionId":"cmtcr6x9g003jl3p2k8c1slti","title":"Submission C1SLTI","payload":{"test_cases":[{"input":["babbc"],"output":"ac"},{"input":[""],"output":""},{"input":["bbbb"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for sensor readings may contain the marker 'b'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_1_b\n return ''.join(c for c in s if c != 'b')\n"}} {"submissionId":"cmtcr6x9g003kl3p2mge9llti","title":"Submission E9LLTI","payload":{"test_cases":[{"input":["cccabc"],"output":4},{"input":[""],"output":0},{"input":["abcabc"],"output":2},{"input":["c"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'c' appears in the label for the warehouse counts case.","reference_solution":"def solve(s):\n # label_count_2_c\n return s.count('c')\n"}} {"submissionId":"cmtcr6x9g003ll3p2dp48275r","title":"Submission 48275R","payload":{"test_cases":[{"input":["cabcc"],"output":"ab"},{"input":[""],"output":""},{"input":["cccc"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for warehouse counts may contain the marker 'c'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_2_c\n return ''.join(c for c in s if c != 'c')\n"}} {"submissionId":"cmtcr6x9g003ml3p2a7f1idqa","title":"Submission F1IDQA","payload":{"test_cases":[{"input":["dddabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["d"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'd' appears in the label for the daily temperatures case.","reference_solution":"def solve(s):\n # label_count_3_d\n return s.count('d')\n"}} {"submissionId":"cmtcr6x9g003nl3p2evyqzll3","title":"Submission YQZLL3","payload":{"test_cases":[{"input":["dabdc"],"output":"abc"},{"input":[""],"output":""},{"input":["dddd"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for daily temperatures may contain the marker 'd'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_3_d\n return ''.join(c for c in s if c != 'd')\n"}} {"submissionId":"cmtcr6x9g003ol3p2qqicwj14","title":"Submission ICWJ14","payload":{"test_cases":[{"input":["eeeabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["e"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'e' appears in the label for the scoreboard values case.","reference_solution":"def solve(s):\n # label_count_4_e\n return s.count('e')\n"}} {"submissionId":"cmtcr6x9g003pl3p2qcvat7vg","title":"Submission VAT7VG","payload":{"test_cases":[{"input":["eabec"],"output":"abc"},{"input":[""],"output":""},{"input":["eeee"],"output":""},{"input":["hello"],"output":"hllo"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for scoreboard values may contain the marker 'e'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_4_e\n return ''.join(c for c in s if c != 'e')\n"}} {"submissionId":"cmtcr6x9g003ql3p2rxshrqic","title":"Submission SHRQIC","payload":{"test_cases":[{"input":["fffabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["f"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'f' appears in the label for the transaction amounts case.","reference_solution":"def solve(s):\n # label_count_5_f\n return s.count('f')\n"}} {"submissionId":"cmtcr6x9g003rl3p27lktkg2f","title":"Submission KTKG2F","payload":{"test_cases":[{"input":["fabfc"],"output":"abc"},{"input":[""],"output":""},{"input":["ffff"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for transaction amounts may contain the marker 'f'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_5_f\n return ''.join(c for c in s if c != 'f')\n"}} {"submissionId":"cmtcr6x9g003sl3p2suboj59e","title":"Submission BOJ59E","payload":{"test_cases":[{"input":["gggabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["g"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'g' appears in the label for the queue lengths case.","reference_solution":"def solve(s):\n # label_count_6_g\n return s.count('g')\n"}} {"submissionId":"cmtcr6x9g003tl3p2n7znvg5g","title":"Submission ZNVG5G","payload":{"test_cases":[{"input":["gabgc"],"output":"abc"},{"input":[""],"output":""},{"input":["gggg"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for queue lengths may contain the marker 'g'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_6_g\n return ''.join(c for c in s if c != 'g')\n"}} {"submissionId":"cmtcr6x9g003ul3p242akvk25","title":"Submission AKVK25","payload":{"test_cases":[{"input":["hhhabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["h"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'h' appears in the label for the packet sizes case.","reference_solution":"def solve(s):\n # label_count_7_h\n return s.count('h')\n"}} {"submissionId":"cmtcr6x9g003vl3p24zylxk6p","title":"Submission YLXK6P","payload":{"test_cases":[{"input":["habhc"],"output":"abc"},{"input":[""],"output":""},{"input":["hhhh"],"output":""},{"input":["hello"],"output":"ello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for packet sizes may contain the marker 'h'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_7_h\n return ''.join(c for c in s if c != 'h')\n"}} {"submissionId":"cmtcr6x9g003wl3p20zcm6z8r","title":"Submission CM6Z8R","payload":{"test_cases":[{"input":["iiiabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["i"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'i' appears in the label for the inventory levels case.","reference_solution":"def solve(s):\n # label_count_8_i\n return s.count('i')\n"}} {"submissionId":"cmtcr6x9g003xl3p2or8so8ma","title":"Submission 8SO8MA","payload":{"test_cases":[{"input":["iabic"],"output":"abc"},{"input":[""],"output":""},{"input":["iiii"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for inventory levels may contain the marker 'i'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_8_i\n return ''.join(c for c in s if c != 'i')\n"}} {"submissionId":"cmtcr6x9g003yl3p2j1wtzwcd","title":"Submission WTZWCD","payload":{"test_cases":[{"input":["jjjabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["j"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'j' appears in the label for the response times case.","reference_solution":"def solve(s):\n # label_count_9_j\n return s.count('j')\n"}} {"submissionId":"cmtcr6x9g003zl3p2l9jdp132","title":"Submission JDP132","payload":{"test_cases":[{"input":["jabjc"],"output":"abc"},{"input":[""],"output":""},{"input":["jjjj"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for response times may contain the marker 'j'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_9_j\n return ''.join(c for c in s if c != 'j')\n"}} {"submissionId":"cmtcr6x9h0040l3p2qdxpp0xy","title":"Submission XPP0XY","payload":{"test_cases":[{"input":["kkkabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["k"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'k' appears in the label for the energy readings case.","reference_solution":"def solve(s):\n # label_count_10_k\n return s.count('k')\n"}} {"submissionId":"cmtcr6x9h0041l3p27ve4r8gl","title":"Submission E4R8GL","payload":{"test_cases":[{"input":["kabkc"],"output":"abc"},{"input":[""],"output":""},{"input":["kkkk"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for energy readings may contain the marker 'k'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_10_k\n return ''.join(c for c in s if c != 'k')\n"}} {"submissionId":"cmtcr6x9h0042l3p27uj6f1zv","title":"Submission J6F1ZV","payload":{"test_cases":[{"input":["lllabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["l"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'l' appears in the label for the vote totals case.","reference_solution":"def solve(s):\n # label_count_11_l\n return s.count('l')\n"}} {"submissionId":"cmtcr6x9h0043l3p2tgm60nzq","title":"Submission M60NZQ","payload":{"test_cases":[{"input":["lablc"],"output":"abc"},{"input":[""],"output":""},{"input":["llll"],"output":""},{"input":["hello"],"output":"heo"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for vote totals may contain the marker 'l'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_11_l\n return ''.join(c for c in s if c != 'l')\n"}} {"submissionId":"cmtcr6x9h0044l3p28so3o1f9","title":"Submission O3O1F9","payload":{"test_cases":[{"input":["mmmabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["m"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'm' appears in the label for the step counts case.","reference_solution":"def solve(s):\n # label_count_12_m\n return s.count('m')\n"}} {"submissionId":"cmtcr6x9h0045l3p2p0c00nwb","title":"Submission C00NWB","payload":{"test_cases":[{"input":["mabmc"],"output":"abc"},{"input":[""],"output":""},{"input":["mmmm"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for step counts may contain the marker 'm'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_12_m\n return ''.join(c for c in s if c != 'm')\n"}} {"submissionId":"cmtcr6x9h0046l3p2hkelq729","title":"Submission ELQ729","payload":{"test_cases":[{"input":["nnnabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["n"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'n' appears in the label for the page-view counts case.","reference_solution":"def solve(s):\n # label_count_13_n\n return s.count('n')\n"}} {"submissionId":"cmtcr6x9h0047l3p24jjmvcsz","title":"Submission JMVCSZ","payload":{"test_cases":[{"input":["nabnc"],"output":"abc"},{"input":[""],"output":""},{"input":["nnnn"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for page-view counts may contain the marker 'n'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_13_n\n return ''.join(c for c in s if c != 'n')\n"}} {"submissionId":"cmtcr6x9h0048l3p28imw8lne","title":"Submission MW8LNE","payload":{"test_cases":[{"input":["oooabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["o"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'o' appears in the label for the task durations case.","reference_solution":"def solve(s):\n # label_count_14_o\n return s.count('o')\n"}} {"submissionId":"cmtcr6x9h0049l3p2af9urc5x","title":"Submission 9URC5X","payload":{"test_cases":[{"input":["oaboc"],"output":"abc"},{"input":[""],"output":""},{"input":["oooo"],"output":""},{"input":["hello"],"output":"hell"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for task durations may contain the marker 'o'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_14_o\n return ''.join(c for c in s if c != 'o')\n"}} {"submissionId":"cmtcr6x9h004al3p2dd2akq4c","title":"Submission 2AKQ4C","payload":{"test_cases":[{"input":["pppabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["p"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'p' appears in the label for the altitude samples case.","reference_solution":"def solve(s):\n # label_count_15_p\n return s.count('p')\n"}} {"submissionId":"cmtcr6x9h004bl3p2o38uwt8s","title":"Submission 8UWT8S","payload":{"test_cases":[{"input":["pabpc"],"output":"abc"},{"input":[""],"output":""},{"input":["pppp"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for altitude samples may contain the marker 'p'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_15_p\n return ''.join(c for c in s if c != 'p')\n"}} {"submissionId":"cmtcr6x9h004cl3p2ns8wwswl","title":"Submission 8WWSWL","payload":{"test_cases":[{"input":["qqqabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["q"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'q' appears in the label for the price changes case.","reference_solution":"def solve(s):\n # label_count_16_q\n return s.count('q')\n"}} {"submissionId":"cmtcr6x9h004dl3p2f9qxkw7g","title":"Submission QXKW7G","payload":{"test_cases":[{"input":["qabqc"],"output":"abc"},{"input":[""],"output":""},{"input":["qqqq"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for price changes may contain the marker 'q'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_16_q\n return ''.join(c for c in s if c != 'q')\n"}} {"submissionId":"cmtcr6x9h004el3p2j3ez7u3u","title":"Submission EZ7U3U","payload":{"test_cases":[{"input":["rrrabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["r"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 'r' appears in the label for the error counts case.","reference_solution":"def solve(s):\n # label_count_17_r\n return s.count('r')\n"}} {"submissionId":"cmtcr6x9h004fl3p239x48zjp","title":"Submission X48ZJP","payload":{"test_cases":[{"input":["rabrc"],"output":"abc"},{"input":[""],"output":""},{"input":["rrrr"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for error counts may contain the marker 'r'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_17_r\n return ''.join(c for c in s if c != 'r')\n"}} {"submissionId":"cmtcr6x9h004gl3p2oefxmoue","title":"Submission FXMOUE","payload":{"test_cases":[{"input":["sssabc"],"output":3},{"input":[""],"output":0},{"input":["abcabc"],"output":0},{"input":["s"],"output":1}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A log label is represented as a lowercase string. Count how many times the character 's' appears in the label for the memory samples case.","reference_solution":"def solve(s):\n # label_count_18_s\n return s.count('s')\n"}} {"submissionId":"cmtcr6x9h004hl3p2dp9xztzz","title":"Submission 9XZTZZ","payload":{"test_cases":[{"input":["sabsc"],"output":"abc"},{"input":[""],"output":""},{"input":["ssss"],"output":""},{"input":["hello"],"output":"hello"}],"constraints":"0 <= length <= 10^5; lowercase English letters only","time_limit_ms":500,"problem_statement":"A tag for memory samples may contain the marker 's'. Remove every occurrence of that marker and return the cleaned tag.","reference_solution":"def solve(s):\n # label_remove_18_s\n return ''.join(c for c in s if c != 's')\n"}} {"submissionId":"cmtcr6x9h004il3p2y8cs23wj","title":"Submission CS23WJ","payload":{"test_cases":[{"input":[[1,2,3]],"output":[4,5,6]},{"input":[[]],"output":[]},{"input":[[-3,0,3]],"output":[0,3,6]},{"input":[[5]],"output":[8]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of sensor readings must be adjusted upward by 3. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_1_plus_3\n return [x + 3 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004jl3p21umakb7d","title":"Submission MAKB7D","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of sensor readings, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_1_sensor_readings\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004kl3p2uyog1vai","title":"Submission OG1VAI","payload":{"test_cases":[{"input":[[1,2,3]],"output":[5,6,7]},{"input":[[]],"output":[]},{"input":[[-4,0,4]],"output":[0,4,8]},{"input":[[5]],"output":[9]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of warehouse counts must be adjusted upward by 4. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_2_plus_4\n return [x + 4 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004ll3p2fxb5z2mg","title":"Submission B5Z2MG","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of warehouse counts, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_2_warehouse_counts\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004ml3p2209ls9tc","title":"Submission 9LS9TC","payload":{"test_cases":[{"input":[[1,2,3]],"output":[6,7,8]},{"input":[[]],"output":[]},{"input":[[-5,0,5]],"output":[0,5,10]},{"input":[[5]],"output":[10]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of daily temperatures must be adjusted upward by 5. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_3_plus_5\n return [x + 5 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004nl3p2egukv9ym","title":"Submission UKV9YM","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of daily temperatures, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_3_daily_temperatures\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004ol3p2jlyncha0","title":"Submission YNCHA0","payload":{"test_cases":[{"input":[[1,2,3]],"output":[7,8,9]},{"input":[[]],"output":[]},{"input":[[-6,0,6]],"output":[0,6,12]},{"input":[[5]],"output":[11]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of scoreboard values must be adjusted upward by 6. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_4_plus_6\n return [x + 6 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004pl3p2uvqkok5s","title":"Submission QKOK5S","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of scoreboard values, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_4_scoreboard_values\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004ql3p2x0mcrtdy","title":"Submission MCRTDY","payload":{"test_cases":[{"input":[[1,2,3]],"output":[8,9,10]},{"input":[[]],"output":[]},{"input":[[-7,0,7]],"output":[0,7,14]},{"input":[[5]],"output":[12]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of transaction amounts must be adjusted upward by 7. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_5_plus_7\n return [x + 7 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004rl3p2lfmht7n2","title":"Submission MHT7N2","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of transaction amounts, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_5_transaction_amounts\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004sl3p2sjq7y7m0","title":"Submission Q7Y7M0","payload":{"test_cases":[{"input":[[1,2,3]],"output":[9,10,11]},{"input":[[]],"output":[]},{"input":[[-8,0,8]],"output":[0,8,16]},{"input":[[5]],"output":[13]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of queue lengths must be adjusted upward by 8. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_6_plus_8\n return [x + 8 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004tl3p2e5jg2kfq","title":"Submission JG2KFQ","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of queue lengths, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_6_queue_lengths\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004ul3p22v3legxb","title":"Submission 3LEGXB","payload":{"test_cases":[{"input":[[1,2,3]],"output":[10,11,12]},{"input":[[]],"output":[]},{"input":[[-9,0,9]],"output":[0,9,18]},{"input":[[5]],"output":[14]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of packet sizes must be adjusted upward by 9. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_7_plus_9\n return [x + 9 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004vl3p2j5kimhqa","title":"Submission KIMHQA","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of packet sizes, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_7_packet_sizes\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004wl3p2j980ge57","title":"Submission 80GE57","payload":{"test_cases":[{"input":[[1,2,3]],"output":[11,12,13]},{"input":[[]],"output":[]},{"input":[[-10,0,10]],"output":[0,10,20]},{"input":[[5]],"output":[15]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of inventory levels must be adjusted upward by 10. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_8_plus_10\n return [x + 10 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004xl3p2k21woo5z","title":"Submission 1WOO5Z","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of inventory levels, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_8_inventory_levels\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h004yl3p2g0oquti6","title":"Submission OQUTI6","payload":{"test_cases":[{"input":[[1,2,3]],"output":[12,13,14]},{"input":[[]],"output":[]},{"input":[[-11,0,11]],"output":[0,11,22]},{"input":[[5]],"output":[16]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of response times must be adjusted upward by 11. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_9_plus_11\n return [x + 11 for x in nums]\n"}} {"submissionId":"cmtcr6x9h004zl3p21pwf4qwr","title":"Submission WF4QWR","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of response times, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_9_response_times\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9h0050l3p2wa0khbnc","title":"Submission 0KHBNC","payload":{"test_cases":[{"input":[[1,2,3]],"output":[13,14,15]},{"input":[[]],"output":[]},{"input":[[-12,0,12]],"output":[0,12,24]},{"input":[[5]],"output":[17]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of energy readings must be adjusted upward by 12. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_10_plus_12\n return [x + 12 for x in nums]\n"}} {"submissionId":"cmtcr6x9h0051l3p2khj58mwm","title":"Submission J58MWM","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of energy readings, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_10_energy_readings\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i0052l3p2qd0nrwwl","title":"Submission 0NRWWL","payload":{"test_cases":[{"input":[[1,2,3]],"output":[14,15,16]},{"input":[[]],"output":[]},{"input":[[-13,0,13]],"output":[0,13,26]},{"input":[[5]],"output":[18]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of vote totals must be adjusted upward by 13. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_11_plus_13\n return [x + 13 for x in nums]\n"}} {"submissionId":"cmtcr6x9i0053l3p21754p2lh","title":"Submission 54P2LH","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of vote totals, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_11_vote_totals\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i0054l3p2ovj0ny2g","title":"Submission J0NY2G","payload":{"test_cases":[{"input":[[1,2,3]],"output":[15,16,17]},{"input":[[]],"output":[]},{"input":[[-14,0,14]],"output":[0,14,28]},{"input":[[5]],"output":[19]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of step counts must be adjusted upward by 14. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_12_plus_14\n return [x + 14 for x in nums]\n"}} {"submissionId":"cmtcr6x9i0055l3p2xr01swp2","title":"Submission 01SWP2","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of step counts, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_12_step_counts\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i0056l3p20v8ytnep","title":"Submission 8YTNEP","payload":{"test_cases":[{"input":[[1,2,3]],"output":[16,17,18]},{"input":[[]],"output":[]},{"input":[[-15,0,15]],"output":[0,15,30]},{"input":[[5]],"output":[20]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of page-view counts must be adjusted upward by 15. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_13_plus_15\n return [x + 15 for x in nums]\n"}} {"submissionId":"cmtcr6x9i0057l3p21r80qnrs","title":"Submission 80QNRS","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of page-view counts, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_13_page-view_counts\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i0058l3p2rcinx14o","title":"Submission INX14O","payload":{"test_cases":[{"input":[[1,2,3]],"output":[17,18,19]},{"input":[[]],"output":[]},{"input":[[-16,0,16]],"output":[0,16,32]},{"input":[[5]],"output":[21]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of task durations must be adjusted upward by 16. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_14_plus_16\n return [x + 16 for x in nums]\n"}} {"submissionId":"cmtcr6x9i0059l3p2kdf3s86l","title":"Submission F3S86L","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of task durations, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_14_task_durations\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i005al3p2nu94alyr","title":"Submission 94ALYR","payload":{"test_cases":[{"input":[[1,2,3]],"output":[18,19,20]},{"input":[[]],"output":[]},{"input":[[-17,0,17]],"output":[0,17,34]},{"input":[[5]],"output":[22]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of altitude samples must be adjusted upward by 17. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_15_plus_17\n return [x + 17 for x in nums]\n"}} {"submissionId":"cmtcr6x9i005bl3p2kb2b2yyv","title":"Submission 2B2YYV","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of altitude samples, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_15_altitude_samples\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i005cl3p28pglgo26","title":"Submission GLGO26","payload":{"test_cases":[{"input":[[1,2,3]],"output":[19,20,21]},{"input":[[]],"output":[]},{"input":[[-18,0,18]],"output":[0,18,36]},{"input":[[5]],"output":[23]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of price changes must be adjusted upward by 18. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_16_plus_18\n return [x + 18 for x in nums]\n"}} {"submissionId":"cmtcr6x9i005dl3p2t5tygaps","title":"Submission TYGAPS","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of price changes, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_16_price_changes\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i005el3p2k6hr9gru","title":"Submission HR9GRU","payload":{"test_cases":[{"input":[[1,2,3]],"output":[20,21,22]},{"input":[[]],"output":[]},{"input":[[-19,0,19]],"output":[0,19,38]},{"input":[[5]],"output":[24]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of error counts must be adjusted upward by 19. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_17_plus_19\n return [x + 19 for x in nums]\n"}} {"submissionId":"cmtcr6x9i005fl3p2qlij8zx7","title":"Submission IJ8ZX7","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of error counts, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_17_error_counts\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i005gl3p2n27g4ew3","title":"Submission 7G4EW3","payload":{"test_cases":[{"input":[[1,2,3]],"output":[21,22,23]},{"input":[[]],"output":[]},{"input":[[-20,0,20]],"output":[0,20,40]},{"input":[[5]],"output":[25]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"Each value in a sequence of memory samples must be adjusted upward by 20. Return the adjusted sequence.","reference_solution":"def solve(nums):\n # adjust_18_plus_20\n return [x + 20 for x in nums]\n"}} {"submissionId":"cmtcr6x9i005hl3p27juxrmsh","title":"Submission UXRMSH","payload":{"test_cases":[{"input":[[1,2,3]],"output":[1,3,6]},{"input":[[]],"output":[]},{"input":[[-1,1,-1]],"output":[-1,0,-1]},{"input":[[5]],"output":[5]}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For a sequence of memory samples, compute prefix totals so that position i contains the sum from the first value through position i.","reference_solution":"def solve(nums):\n # prefix_18_memory_samples\n out = []\n total = 0\n for x in nums:\n total += x\n out.append(total)\n return out\n"}} {"submissionId":"cmtcr6x9i005il3p2j30q39qi","title":"Submission 0Q39QI","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":1},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null},{"input":[[7,7]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For sensor readings, return the first integer that appears a second time while scanning left to right. Return None if no value repeats.","reference_solution":"def solve(nums):\n # first_repeat_1_sensor_readings\n seen = set()\n for x in nums:\n if x in seen:\n return x\n seen.add(x)\n return None\n"}} {"submissionId":"cmtcr6x9i005jl3p2jbe4kzb4","title":"Submission E4KZB4","payload":{"test_cases":[{"input":[[4,1,9]],"output":8},{"input":[[]],"output":0},{"input":[[7]],"output":0},{"input":[[-5,-2,-9]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For warehouse counts, return the difference between the maximum and minimum values. Return 0 when the sequence is empty.","reference_solution":"def solve(nums):\n # span_2_warehouse_counts\n if not nums:\n return 0\n return max(nums) - min(nums)\n"}} {"submissionId":"cmtcr6x9i005kl3p2t47k0u5w","title":"Submission 7K0U5W","payload":{"test_cases":[{"input":[[1,2,2,5]],"output":true},{"input":[[3,2]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For daily temperatures, determine whether the sequence is non-decreasing: every value must be at least the value immediately before it.","reference_solution":"def solve(nums):\n # nondecreasing_3_daily_temperatures\n return all(nums[j] <= nums[j+1] for j in range(len(nums)-1))\n"}} {"submissionId":"cmtcr6x9i005ll3p2yow1ztns","title":"Submission W1ZTNS","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":1},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null},{"input":[[7,7]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For scoreboard values, return the first integer that appears a second time while scanning left to right. Return None if no value repeats.","reference_solution":"def solve(nums):\n # first_repeat_4_scoreboard_values\n seen = set()\n for x in nums:\n if x in seen:\n return x\n seen.add(x)\n return None\n"}} {"submissionId":"cmtcr6x9i005ml3p2l2wz50y6","title":"Submission WZ50Y6","payload":{"test_cases":[{"input":[[4,1,9]],"output":8},{"input":[[]],"output":0},{"input":[[7]],"output":0},{"input":[[-5,-2,-9]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For transaction amounts, return the difference between the maximum and minimum values. Return 0 when the sequence is empty.","reference_solution":"def solve(nums):\n # span_5_transaction_amounts\n if not nums:\n return 0\n return max(nums) - min(nums)\n"}} {"submissionId":"cmtcr6x9i005nl3p2q3pzuraw","title":"Submission PZURAW","payload":{"test_cases":[{"input":[[1,2,2,5]],"output":true},{"input":[[3,2]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For queue lengths, determine whether the sequence is non-decreasing: every value must be at least the value immediately before it.","reference_solution":"def solve(nums):\n # nondecreasing_6_queue_lengths\n return all(nums[j] <= nums[j+1] for j in range(len(nums)-1))\n"}} {"submissionId":"cmtcr6x9i005ol3p2zzjjrr5o","title":"Submission JJRR5O","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":1},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null},{"input":[[7,7]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For packet sizes, return the first integer that appears a second time while scanning left to right. Return None if no value repeats.","reference_solution":"def solve(nums):\n # first_repeat_7_packet_sizes\n seen = set()\n for x in nums:\n if x in seen:\n return x\n seen.add(x)\n return None\n"}} {"submissionId":"cmtcr6x9i005pl3p2uazf61cq","title":"Submission ZF61CQ","payload":{"test_cases":[{"input":[[4,1,9]],"output":8},{"input":[[]],"output":0},{"input":[[7]],"output":0},{"input":[[-5,-2,-9]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For inventory levels, return the difference between the maximum and minimum values. Return 0 when the sequence is empty.","reference_solution":"def solve(nums):\n # span_8_inventory_levels\n if not nums:\n return 0\n return max(nums) - min(nums)\n"}} {"submissionId":"cmtcr6x9i005ql3p2ce6c6ew6","title":"Submission 6C6EW6","payload":{"test_cases":[{"input":[[1,2,2,5]],"output":true},{"input":[[3,2]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For response times, determine whether the sequence is non-decreasing: every value must be at least the value immediately before it.","reference_solution":"def solve(nums):\n # nondecreasing_9_response_times\n return all(nums[j] <= nums[j+1] for j in range(len(nums)-1))\n"}} {"submissionId":"cmtcr6x9i005rl3p2so46wkqc","title":"Submission 46WKQC","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":1},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null},{"input":[[7,7]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For energy readings, return the first integer that appears a second time while scanning left to right. Return None if no value repeats.","reference_solution":"def solve(nums):\n # first_repeat_10_energy_readings\n seen = set()\n for x in nums:\n if x in seen:\n return x\n seen.add(x)\n return None\n"}} {"submissionId":"cmtcr6x9i005sl3p2u5zc4cq8","title":"Submission ZC4CQ8","payload":{"test_cases":[{"input":[[4,1,9]],"output":8},{"input":[[]],"output":0},{"input":[[7]],"output":0},{"input":[[-5,-2,-9]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For vote totals, return the difference between the maximum and minimum values. Return 0 when the sequence is empty.","reference_solution":"def solve(nums):\n # span_11_vote_totals\n if not nums:\n return 0\n return max(nums) - min(nums)\n"}} {"submissionId":"cmtcr6x9i005tl3p2nmqnmreh","title":"Submission QNMREH","payload":{"test_cases":[{"input":[[1,2,2,5]],"output":true},{"input":[[3,2]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For step counts, determine whether the sequence is non-decreasing: every value must be at least the value immediately before it.","reference_solution":"def solve(nums):\n # nondecreasing_12_step_counts\n return all(nums[j] <= nums[j+1] for j in range(len(nums)-1))\n"}} {"submissionId":"cmtcr6x9i005ul3p2jtoto7cn","title":"Submission OTO7CN","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":1},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null},{"input":[[7,7]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For page-view counts, return the first integer that appears a second time while scanning left to right. Return None if no value repeats.","reference_solution":"def solve(nums):\n # first_repeat_13_page-view_counts\n seen = set()\n for x in nums:\n if x in seen:\n return x\n seen.add(x)\n return None\n"}} {"submissionId":"cmtcr6x9i005vl3p2qusj4t4c","title":"Submission SJ4T4C","payload":{"test_cases":[{"input":[[4,1,9]],"output":8},{"input":[[]],"output":0},{"input":[[7]],"output":0},{"input":[[-5,-2,-9]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For task durations, return the difference between the maximum and minimum values. Return 0 when the sequence is empty.","reference_solution":"def solve(nums):\n # span_14_task_durations\n if not nums:\n return 0\n return max(nums) - min(nums)\n"}} {"submissionId":"cmtcr6x9i005wl3p2uvg1resu","title":"Submission G1RESU","payload":{"test_cases":[{"input":[[1,2,2,5]],"output":true},{"input":[[3,2]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For altitude samples, determine whether the sequence is non-decreasing: every value must be at least the value immediately before it.","reference_solution":"def solve(nums):\n # nondecreasing_15_altitude_samples\n return all(nums[j] <= nums[j+1] for j in range(len(nums)-1))\n"}} {"submissionId":"cmtcr6x9i005xl3p2v3qhbhns","title":"Submission QHBHNS","payload":{"test_cases":[{"input":[[3,1,4,1,5]],"output":1},{"input":[[1,2,3]],"output":null},{"input":[[]],"output":null},{"input":[[7,7]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For price changes, return the first integer that appears a second time while scanning left to right. Return None if no value repeats.","reference_solution":"def solve(nums):\n # first_repeat_16_price_changes\n seen = set()\n for x in nums:\n if x in seen:\n return x\n seen.add(x)\n return None\n"}} {"submissionId":"cmtcr6x9i005yl3p2s247jlas","title":"Submission 47JLAS","payload":{"test_cases":[{"input":[[4,1,9]],"output":8},{"input":[[]],"output":0},{"input":[[7]],"output":0},{"input":[[-5,-2,-9]],"output":7}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For error counts, return the difference between the maximum and minimum values. Return 0 when the sequence is empty.","reference_solution":"def solve(nums):\n # span_17_error_counts\n if not nums:\n return 0\n return max(nums) - min(nums)\n"}} {"submissionId":"cmtcr6x9i005zl3p2fx07t8kq","title":"Submission 07T8KQ","payload":{"test_cases":[{"input":[[1,2,2,5]],"output":true},{"input":[[3,2]],"output":false},{"input":[[]],"output":true},{"input":[[7]],"output":true}],"constraints":"0 <= n <= 10^5, -10^9 <= value <= 10^9","time_limit_ms":500,"problem_statement":"For memory samples, determine whether the sequence is non-decreasing: every value must be at least the value immediately before it.","reference_solution":"def solve(nums):\n # nondecreasing_18_memory_samples\n return all(nums[j] <= nums[j+1] for j in range(len(nums)-1))\n"}}