-- Migration: 008_add_more_challenges.sql -- Description: Add 20 more coding challenges. SET autocommit=0; START TRANSACTION; -- -- Seed data for table `challenges` -- INSERT INTO `challenges` (`title`, `description`, `difficulty`, `challenge_type`, `sample_cases_json`, `expected_output`, `learning_style`) VALUES ('Palindrome Checker', 'Write a Python function to check if a given string is a palindrome.', 'beginner', 'python', '[{"input": "racecar", "output": "True"}, {"input": "hello", "output": "False"}]', 'True', 'kinesthetic'), ('Fibonacci Sequence', 'Write a Python function to generate the Fibonacci sequence up to a given number of terms.', 'beginner', 'python', '[{"input": "5", "output": "[0, 1, 1, 2, 3]"}, {"input": "8", "output": "[0, 1, 1, 2, 3, 5, 8, 13]"}]', '[0, 1, 1, 2, 3]', 'kinesthetic'), ('Find the largest number in a list', 'Write a Python function to find the largest number in a given list of numbers.', 'beginner', 'python', '[{"input": "[1, 2, 3, 4, 5]", "output": "5"}, {"input": "[-1, -5, -3]", "output": "-1"}]', '5', 'kinesthetic'), ('Find the smallest number in a list', 'Write a Python function to find the smallest number in a given list of numbers.', 'beginner', 'python', '[{"input": "[1, 2, 3, 4, 5]", "output": "1"}, {"input": "[-1, -5, -3]", "output": "-5"}]', '1', 'kinesthetic'), ('Count the number of vowels in a string', 'Write a Python function to count the number of vowels in a given string.', 'beginner', 'python', '[{"input": "hello", "output": "2"}, {"input": "world", "output": "1"}]', '2', 'kinesthetic'), ('Check if a number is prime', 'Write a Python function to check if a given number is prime.', 'intermediate', 'python', '[{"input": "5", "output": "True"}, {"input": "10", "output": "False"}]', 'True', 'kinesthetic'), ('Merge two sorted lists', 'Write a Python function to merge two sorted lists into a single sorted list.', 'intermediate', 'python', '[{"input": "([1, 3, 5], [2, 4, 6])", "output": "[1, 2, 3, 4, 5, 6]"}]', '[1, 2, 3, 4, 5, 6]', 'kinesthetic'), ('Find the intersection of two lists', 'Write a Python function to find the intersection of two lists.', 'intermediate', 'python', '[{"input": "([1, 2, 3, 4], [3, 4, 5, 6])", "output": "[3, 4]"}]', '[3, 4]', 'kinesthetic'), ('Find the union of two lists', 'Write a Python function to find the union of two lists.', 'intermediate', 'python', '[{"input": "([1, 2, 3, 4], [3, 4, 5, 6])", "output": "[1, 2, 3, 4, 5, 6]"}]', '[1, 2, 3, 4, 5, 6]', 'kinesthetic'), ('Reverse a linked list', 'Write a Python function to reverse a singly linked list.', 'advanced', 'python', '[]', '', 'kinesthetic'), ('Implement a queue using two stacks', 'Implement a queue data structure using two stacks in Python.', 'advanced', 'python', '[]', '', 'kinesthetic'), ('Implement a stack using two queues', 'Implement a stack data structure using two queues in Python.', 'advanced', 'python', '[]', '', 'kinesthetic'), ('Find the missing number in a list', 'Given a list of n-1 integers in the range of 1 to n, find the missing number.', 'intermediate', 'python', '[{"input": "[1, 2, 4, 5, 6]", "output": "3"}]', '3', 'kinesthetic'), ('Find the duplicate number in a list', 'Given a list of n+1 integers in the range of 1 to n, find the duplicate number.', 'intermediate', 'python', '[{"input": "[1, 2, 3, 4, 4, 5]", "output": "4"}]', '4', 'kinesthetic'), ('First non-repeated character', 'Write a Python function to find the first non-repeated character in a string.', 'intermediate', 'python', '[{"input": "swiss", "output": "w"}]', 'w', 'kinesthetic'), ('Longest substring without repeating characters', 'Write a Python function to find the length of the longest substring without repeating characters.', 'advanced', 'python', '[{"input": "abcabcbb", "output": "3"}]', '3', 'kinesthetic'), ('Longest palindromic substring', 'Write a Python function to find the longest palindromic substring in a given string.', 'advanced', 'python', '[{"input": "babad", "output": "bab"}]', 'bab', 'kinesthetic'), ('Implement a Binary Search Tree', 'Implement a Binary Search Tree (BST) in Python with insert, search, and delete operations.', 'advanced', 'python', '[]', '', 'kinesthetic'), ('Implement a Trie', 'Implement a Trie data structure in Python with insert and search operations.', 'advanced', 'python', '[]', '', 'kinesthetic'), ('Implement a Graph', 'Implement a Graph data structure in Python with methods to add vertices and edges.', 'advanced', 'python', '[]', '', 'kinesthetic'); COMMIT;