conversations
listlengths
2
2
[ { "from": "human", "value": "Implement a token bucket rate limiter with configurable capacity and refill rate." }, { "from": "gpt", "value": "<think>\nThe user wants me to implement a token bucket rate limiter with configurable capacity and refill rate. I'll implement this in a clean, production...
[ { "from": "human", "value": "Write a function that merges overlapping intervals and returns the simplified list." }, { "from": "gpt", "value": "<think>\nWe need to write a function that merges overlapping intervals and returns the simplified list. The problem is straightforward: given a list of ...
[ { "from": "human", "value": "Build a parser that converts a simple markdown document into semantic HTML." }, { "from": "gpt", "value": "<think>\nThe user wants me to build a parser that converts simple markdown into semantic HTML. I'll create a comprehensive markdown parser that handles common m...
[ { "from": "human", "value": "Refactor a nested callback chain into an async flow with clear error handling." }, { "from": "gpt", "value": "<think>\nWe need to understand the user's request: \"Refactor a nested callback chain into an async flow with clear error handling.\" Probably the user wants...
[ { "from": "human", "value": "Create a command-line tool that scans a folder and reports duplicate files by checksum." }, { "from": "gpt", "value": "<think>\nThe user wants me to create a command-line tool that scans a folder and reports duplicate files by checksum. I'll build this in Python sinc...
[ { "from": "human", "value": "Write tests for a retry helper that uses exponential backoff and jitter." }, { "from": "gpt", "value": "<think>\nWe need to write tests for a retry helper function that uses exponential backoff and jitter. The user didn't provide the actual implementation, so we need...
[ { "from": "human", "value": "Implement a cache with TTL eviction and least-recently-used replacement." }, { "from": "gpt", "value": "<think>\nWe need to implement a cache with TTL eviction and LRU replacement. The user likely wants a data structure that supports put(key, value, ttl) and get(key)...
[ { "from": "human", "value": "Debug a race condition in a worker queue that occasionally drops jobs." }, { "from": "gpt", "value": "<think>\nWe need to debug a race condition in a worker queue that occasionally drops jobs. The user wants a solution or analysis. As an AI, I should provide a struct...
[ { "from": "human", "value": "Design a data model for storing user preferences with versioned migrations." }, { "from": "gpt", "value": "<think>\nWe need to design a data model for storing user preferences with versioned migrations. This is a broad request. The user likely wants a database schema...
[ { "from": "human", "value": "Add pagination to an API endpoint that returns large result sets." }, { "from": "gpt", "value": "<think>\nWe need to add pagination to an API endpoint that returns large result sets. The user likely expects guidance on how to implement pagination, including parameter...
[ { "from": "human", "value": "Write a function that finds the longest substring without repeating characters." }, { "from": "gpt", "value": "<think>\nWe need to write a function that finds the longest substring without repeating characters. The user didn't specify language, so I'll assume Python ...
[ { "from": "human", "value": "Implement a breadth-first search that returns the shortest path in an unweighted graph." }, { "from": "gpt", "value": "<think>\nWe need to implement BFS to find shortest path in unweighted graph. The user didn't specify language, input/output format, etc. Probably ex...
[ { "from": "human", "value": "Create a small logging utility with levels, timestamps, and structured metadata." }, { "from": "gpt", "value": "<think>\nWe need to create a small logging utility with levels, timestamps, and structured metadata. The user didn't specify language, but likely wants a c...
[ { "from": "human", "value": "Refactor a large switch statement into a more maintainable dispatch table." }, { "from": "gpt", "value": "<think>\nWe need to provide a solution for refactoring a large switch statement into a dispatch table. The user didn't provide specific code, so we need to give ...
[ { "from": "human", "value": "Write a SQL query that finds customers with more than three failed payments." }, { "from": "gpt", "value": "<think>\nWe need to write a SQL query to find customers with more than three failed payments. We assume a typical database schema: a 'payments' table with fiel...
[ { "from": "human", "value": "Implement a trie that supports insert, search, and prefix lookup." }, { "from": "gpt", "value": "<think>\nWe need to implement a trie (prefix tree) that supports insert, search, and prefix lookup (startsWith). The user asks: \"Implement a trie that supports insert, s...
[ { "from": "human", "value": "Create a file watcher that reruns a task whenever source files change." }, { "from": "gpt", "value": "<think>\nWe need to create a file watcher that reruns a task whenever source files change. This is a common requirement for development workflows, similar to tools l...
[ { "from": "human", "value": "Optimize a slow loop that repeatedly recalculates the same derived value." }, { "from": "gpt", "value": "<think>\nWe need to provide a response about optimizing a slow loop that repeatedly recalculates the same derived value. The user's query is concise: \"Optimize a...
[ { "from": "human", "value": "Write a function that serializes an object graph while handling circular references." }, { "from": "gpt", "value": "<think>\nWe need to write a function that serializes an object graph while handling circular references. The user expects a coding solution. Probably i...
[ { "from": "human", "value": "Add unit tests for a date parser that accepts multiple input formats." }, { "from": "gpt", "value": "<think>\nWe need to add unit tests for a date parser that accepts multiple input formats. The user doesn't provide the actual parser implementation, so we need to wri...
[ { "from": "human", "value": "Implement a debounce helper that preserves the latest arguments and return value." }, { "from": "gpt", "value": "<think>\nWe need to implement a debounce helper. The user wants: \"a debounce helper that preserves the latest arguments and return value.\" This likely m...
[ { "from": "human", "value": "Create a React component that renders a searchable, keyboard-friendly list." }, { "from": "gpt", "value": "<think>\nWe need to create a React component for a searchable, keyboard-friendly list. This is a common UI pattern (like a command palette, autocomplete dropdow...
[ { "from": "human", "value": "Write a function that groups anagrams while preserving input order within groups." }, { "from": "gpt", "value": "<think>\nWe need to write a function that groups anagrams while preserving input order within groups. The problem statement is straightforward: given a li...
[ { "from": "human", "value": "Design a background job system that retries failures and records attempt history." }, { "from": "gpt", "value": "<think>\nWe need to design a background job system with retries and attempt history. This is a system design question. We should cover:\n\n- Requirements:...
[ { "from": "human", "value": "Build a CSV importer that validates columns and reports row-level errors." }, { "from": "gpt", "value": "<think>\nWe need to build a CSV importer that validates columns and reports row-level errors. This is a coding task. The user didn't specify language, but likely ...
[ { "from": "human", "value": "Refactor duplicated input sanitization logic into a shared helper." }, { "from": "gpt", "value": "<think>\nWe need to refactor duplicated input sanitization logic into a shared helper. The user hasn't provided any code, so I need to ask for more context or provide a ...
[ { "from": "human", "value": "Implement a stack that can return the minimum element in constant time." }, { "from": "gpt", "value": "<think>\nWe need to implement a stack that supports push, pop, top, and getMin operations, all in O(1) time. This is a classic problem. The typical solution uses an...
[ { "from": "human", "value": "Create a shell script that archives logs older than thirty days." }, { "from": "gpt", "value": "<think>\nWe need to create a shell script that archives logs older than thirty days. The user didn't specify the source directory, archive location, compression method, or...
[ { "from": "human", "value": "Write a function that computes the product of array elements except self." }, { "from": "gpt", "value": "<think>\nWe need to write a function that computes the product of array elements except self. This is a classic problem (LeetCode 238: Product of Array Except Sel...
[ { "from": "human", "value": "Build a REST endpoint that accepts a JSON payload and stores it safely." }, { "from": "gpt", "value": "<think>\nWe need to build a REST endpoint that accepts a JSON payload and stores it safely. The user likely wants a simple example, possibly using a common framewor...
[ { "from": "human", "value": "Debug an off-by-one error in a pagination loop that skips the last item." }, { "from": "gpt", "value": "<think>\nWe need to debug an off-by-one error in a pagination loop that skips the last item. The user didn't provide code, so we need to give a general debugging a...
[ { "from": "human", "value": "Implement a priority queue for scheduling jobs by deadline." }, { "from": "gpt", "value": "<think>\nWe need to implement a priority queue for scheduling jobs by deadline. The user asks for \"Implement a priority queue for scheduling jobs by deadline.\" Likely they wa...
[ { "from": "human", "value": "Create a small library for parsing and normalizing relative file paths." }, { "from": "gpt", "value": "<think>\nWe need to create a small library for parsing and normalizing relative file paths. The user wants a library in JavaScript/TypeScript presumably. They menti...
[ { "from": "human", "value": "Write tests that verify a cache invalidation policy under concurrent access." }, { "from": "gpt", "value": "<think>\nWe need to write tests that verify a cache invalidation policy under concurrent access. The user wants to test that a cache invalidation policy works ...
[ { "from": "human", "value": "Design a schema for storing audit logs with searchable fields." }, { "from": "gpt", "value": "<think>\nWe need to design a schema for audit logs with searchable fields. The user didn't specify the context (e.g., database type, requirements like high write throughput,...
[ { "from": "human", "value": "Implement topological sort for a dependency graph with cycle detection." }, { "from": "gpt", "value": "<think>\nWe need to implement topological sort for a dependency graph with cycle detection. The user wants a function or algorithm that takes a directed graph (pres...
[ { "from": "human", "value": "Refactor a utility module to remove side effects from its public functions." }, { "from": "gpt", "value": "<think>\nWe need to refactor a utility module to remove side effects from public functions. The user didn't provide the actual code, so we need to give general ...
[ { "from": "human", "value": "Create a CLI that compares two directories and reports changed files." }, { "from": "gpt", "value": "<think>\nWe need to create a CLI tool that compares two directories and reports changed files. The user wants a command-line interface (CLI) that takes two directory ...
[ { "from": "human", "value": "Write a function that rotates an array in place by k positions." }, { "from": "gpt", "value": "<think>\nWe need to write a function that rotates an array in place by k positions. The problem statement is brief. We need to clarify: rotate left or right? Typically \"ro...
[ { "from": "human", "value": "Implement a websocket message handler with reconnect and heartbeat logic." }, { "from": "gpt", "value": "<think>\nWe need to implement a WebSocket message handler with reconnect and heartbeat logic. The user didn't specify language, but common ones are JavaScript (No...
[ { "from": "human", "value": "Build a small image metadata extractor that reads width, height, and format." }, { "from": "gpt", "value": "<think>\nThe user wants me to build a small image metadata extractor that reads width, height, and format of an image. I'll create a simple, clean implementati...
[ { "from": "human", "value": "Debug a memory leak caused by event listeners that are never removed." }, { "from": "gpt", "value": "<think>\nWe need to debug a memory leak caused by event listeners that are never removed. The user likely expects a guide on identifying and fixing such leaks. The an...
[ { "from": "human", "value": "Write a function that finds the median of two sorted arrays." }, { "from": "gpt", "value": "<think>\nWe need to write a function that finds the median of two sorted arrays. This is a classic problem (LeetCode 4). The goal is to implement an efficient algorithm with O...
[ { "from": "human", "value": "Implement a simple permission system with roles and resource checks." }, { "from": "gpt", "value": "<think>\nWe need to implement a simple permission system with roles and resource checks. The user likely wants a code implementation, probably in Python, JavaScript, o...
[ { "from": "human", "value": "Add integration tests for an endpoint that uploads and processes files." }, { "from": "gpt", "value": "<think>\nWe need to add integration tests for an endpoint that uploads and processes files. The user didn't specify the technology stack, but we can assume a common...
[ { "from": "human", "value": "Design a webhook delivery system with retries and dead-letter handling." }, { "from": "gpt", "value": "<think>\nWe need to design a webhook delivery system with retries and dead-letter handling. This is a system design question. The user asks: \"Design a webhook deli...
[ { "from": "human", "value": "Write a function that validates whether a binary tree is a binary search tree." }, { "from": "gpt", "value": "<think>\nWe need to write a function that validates whether a binary tree is a binary search tree. The user didn't specify the language, but typically we can...
[ { "from": "human", "value": "Implement a rate-limited API client that backs off on server errors." }, { "from": "gpt", "value": "<think>\nWe need to implement a rate-limited API client that backs off on server errors. The user likely wants a code example, possibly in Python, but the request is o...
[ { "from": "human", "value": "Create a data cleaning pipeline that trims, deduplicates, and normalizes records." }, { "from": "gpt", "value": "<think>\nWe need to create a data cleaning pipeline that trims, deduplicates, and normalizes records. The user likely expects a conceptual design or an im...
[ { "from": "human", "value": "Refactor a stateful class into a pure function plus explicit state object." }, { "from": "gpt", "value": "<think>\nWe need to refactor a stateful class into a pure function plus explicit state object. The user hasn't provided the specific class, so we need to assume ...
[ { "from": "human", "value": "Write a parser for nested parentheses that returns a tree structure." }, { "from": "gpt", "value": "<think>\nWe need to write a parser for nested parentheses that returns a tree structure. The user likely wants a function that takes a string containing parentheses (m...
[ { "from": "human", "value": "Implement a thread-safe counter with increment, decrement, and read operations." }, { "from": "gpt", "value": "<think>\nWe need to implement a thread-safe counter with increment, decrement, and read operations. The user expects a solution, likely in a programming lan...
[ { "from": "human", "value": "Build a feature flag service that can turn flags on by percentage rollout." }, { "from": "gpt", "value": "<think>\nWe need to build a feature flag service with percentage rollout. The user wants a service that can turn flags on by percentage rollout. This is a system...
[ { "from": "human", "value": "Debug why a scheduled task runs twice after a restart." }, { "from": "gpt", "value": "<think>\nWe are asked: \"Debug why a scheduled task runs twice after a restart.\" This is a typical problem in systems that use scheduled tasks (like cron in Linux, Task Scheduler i...
[ { "from": "human", "value": "Write tests for a function that parses ISO 8601 timestamps." }, { "from": "gpt", "value": "<think>\nWe need to write tests for a function that parses ISO 8601 timestamps. The user didn't specify language, but typical context is Python or JavaScript. I'll assume Pytho...
[ { "from": "human", "value": "Implement a function that finds all root-to-leaf paths with a target sum." }, { "from": "gpt", "value": "<think>\nWe need to implement a function that finds all root-to-leaf paths with a target sum. The user didn't specify a language; likely Python or JavaScript. The...
[ { "from": "human", "value": "Create a library for validating environment variables against a schema." }, { "from": "gpt", "value": "<think>\nWe need to create a library for validating environment variables against a schema. The user likely expects a Python library, but could be any language? Usu...
[ { "from": "human", "value": "Build a search box that debounces input and highlights matched terms." }, { "from": "gpt", "value": "<think>\nThe user wants me to build a search box that:\n1. Debounces input (waits for the user to stop typing before searching)\n2. Highlights matched terms in the re...
[ { "from": "human", "value": "Optimize a recursive algorithm by memoizing repeated subproblems." }, { "from": "gpt", "value": "<think>\nWe need to answer the user's query: \"Optimize a recursive algorithm by memoizing repeated subproblems.\" This is a theoretical question about memoization in rec...
[ { "from": "human", "value": "Write a function that finds the kth largest element in an array." }, { "from": "gpt", "value": "<think>\nWe need to write a function that finds the kth largest element in an array. \n\nInterpretation: \"kth largest\" means when sorted descending, the element at posit...
[ { "from": "human", "value": "Implement a small rate limiter using a sliding time window." }, { "from": "gpt", "value": "<think>\nWe need to implement a rate limiter using a sliding time window. This is a common interview question. The user likely expects a code solution (probably in Python or si...
[ { "from": "human", "value": "Create a report generator that turns JSON records into a CSV export." }, { "from": "gpt", "value": "<think>\nWe need to create a report generator that turns JSON records into CSV export. The user likely wants a Python script or function that takes JSON data (maybe fr...
[ { "from": "human", "value": "Refactor error handling so failures return typed results instead of exceptions." }, { "from": "gpt", "value": "<think>\nWe need to refactor error handling to return typed results instead of exceptions. The user didn't provide any specific code. I need to infer the co...
[ { "from": "human", "value": "Implement a checksum calculator for large files streamed in chunks." }, { "from": "gpt", "value": "<think>\nWe need to implement a checksum calculator for large files streamed in chunks. This is a typical task: compute a hash (like SHA-256, MD5, etc.) as data is read...
[ { "from": "human", "value": "Write a function that counts connected components in an undirected graph." }, { "from": "gpt", "value": "<think>\nWe need to write a function that counts connected components in an undirected graph. The user asks: \"Write a function that counts connected components i...
[ { "from": "human", "value": "Create a test double for a network service with configurable latency." }, { "from": "gpt", "value": "<think>\nWe need to create a test double for a network service with configurable latency. The user likely wants a code example or design pattern for a mock/stub that ...
[ { "from": "human", "value": "Design a config loader that merges defaults, files, and environment variables." }, { "from": "gpt", "value": "<think>\nWe need to design a config loader that merges defaults, files, and environment variables. This is a typical task for building a robust configuration...
[ { "from": "human", "value": "Debug a flaky test caused by shared mutable state between test cases." }, { "from": "gpt", "value": "<think>\nWe need to debug a flaky test caused by shared mutable state between test cases. The user likely wants strategies to identify and fix the issue. The answer s...
[ { "from": "human", "value": "Implement a binary search tree with insert, delete, and inorder traversal." }, { "from": "gpt", "value": "<think>\nWe need to implement a binary search tree with insert, delete, and inorder traversal. The user likely expects code in a programming language. Typically ...
[ { "from": "human", "value": "Build a simple task queue with delayed jobs and status tracking." }, { "from": "gpt", "value": "<think>\nWe need to build a simple task queue with delayed jobs and status tracking. The user likely wants a system where tasks can be enqueued with a delay (execute after...
[ { "from": "human", "value": "Write a sanitizer that removes unsafe HTML tags but preserves formatting." }, { "from": "gpt", "value": "<think>\nWe need to write a sanitizer that removes unsafe HTML tags but preserves formatting. The user likely wants a function or code snippet that takes HTML inp...
[ { "from": "human", "value": "Create a compact serializer for user sessions with versioned decoding." }, { "from": "gpt", "value": "<think>\nWe need to create a compact serializer for user sessions with versioned decoding. The user likely wants a data structure and serialization format that can h...
[ { "from": "human", "value": "Refactor repeated database access into a repository abstraction." }, { "from": "gpt", "value": "<think>\nWe need to refactor repeated database access into a repository abstraction. The user didn't provide any code or context. So I need to provide a general answer exp...
[ { "from": "human", "value": "Implement a function that computes the longest increasing subsequence." }, { "from": "gpt", "value": "<think>\nWe need to implement a function that computes the longest increasing subsequence (LIS). The user didn't specify programming language, but typical for such t...
[ { "from": "human", "value": "Build a minimal dashboard card that refreshes data on an interval." }, { "from": "gpt", "value": "<think>\nThe user wants me to build a minimal dashboard card that refreshes data on an interval. I'll create a clean, self-contained HTML page with a dashboard card that...
[ { "from": "human", "value": "Write a migration that adds a nullable column and backfills values safely." }, { "from": "gpt", "value": "<think>\nWe need to write a migration that adds a nullable column and backfills values safely. The user likely wants a database migration script (e.g., for Rails...
[ { "from": "human", "value": "Implement a stream transformer that filters events and maps their shape." }, { "from": "gpt", "value": "<think>\nWe need to implement a stream transformer that filters events and maps their shape. The user likely wants a function or class that takes a stream (e.g., O...
[ { "from": "human", "value": "Create a small encryption wrapper that stores an initialization vector with ciphertext." }, { "from": "gpt", "value": "<think>\nWe need to create a small encryption wrapper that stores an initialization vector (IV) with ciphertext. The user likely wants a code exampl...
[ { "from": "human", "value": "Debug a deserialization bug caused by mismatched field names." }, { "from": "gpt", "value": "<think>\nWe need to debug a deserialization bug caused by mismatched field names. The user likely wants an explanation of how mismatched field names cause deserialization err...
[ { "from": "human", "value": "Write a function that detects whether two linked lists intersect." }, { "from": "gpt", "value": "<think>\nWe need to write a function that detects whether two linked lists intersect. This is a classic problem: given two singly linked lists, determine if they intersec...
[ { "from": "human", "value": "Build a CLI flag parser that supports booleans, strings, and arrays." }, { "from": "gpt", "value": "<think>\nWe need to build a CLI flag parser that supports booleans, strings, and arrays. The user didn't specify language, but likely expecting Python, Go, Rust, or ma...
[ { "from": "human", "value": "Create a log parser that extracts structured fields from mixed-format lines." }, { "from": "gpt", "value": "<think>\nWe need to create a log parser that extracts structured fields from mixed-format lines. The user didn't specify any particular log format, so likely t...
[ { "from": "human", "value": "Refactor a monolithic module into smaller units with explicit dependencies." }, { "from": "gpt", "value": "<think>\nWe need to understand the user's request: \"Refactor a monolithic module into smaller units with explicit dependencies.\" This is a general task descri...
[ { "from": "human", "value": "Write tests for a serializer that must preserve field ordering." }, { "from": "gpt", "value": "<think>\nWe need to write tests for a serializer that must preserve field ordering. This is a broad request. The user didn't specify the serializer framework (e.g., Django ...
[ { "from": "human", "value": "Implement a graph traversal that avoids revisiting nodes in cycles." }, { "from": "gpt", "value": "<think>\nWe need to implement a graph traversal that avoids revisiting nodes in cycles. The user likely wants a depth-first search (DFS) or breadth-first search (BFS) t...
[ { "from": "human", "value": "Build a small upload handler that validates file size and type." }, { "from": "gpt", "value": "<think>\nThe user wants me to build a small upload handler that validates file size and type. I'll create a complete, well-structured solution that includes:\n\n1. HTML for...
[ { "from": "human", "value": "Create a helper that safely deep-clones plain objects and arrays." }, { "from": "gpt", "value": "<think>\nWe need to create a helper that safely deep-clones plain objects and arrays. The user asks for a helper function. Should be written in JavaScript/TypeScript? The...
[ { "from": "human", "value": "Debug a function that intermittently returns undefined for valid input." }, { "from": "gpt", "value": "<think>\nWe need to debug a function that intermittently returns undefined for valid input. The user hasn't provided the actual function or code. So I should ask fo...
[ { "from": "human", "value": "Implement a dynamic programming solution for the coin change problem." }, { "from": "gpt", "value": "<think>\nWe need to implement a dynamic programming solution for the coin change problem. The user didn't specify which variant: \"coin change problem\" could refer t...
[ { "from": "human", "value": "Write a component that renders a table with sortable columns." }, { "from": "gpt", "value": "<think>\nWe need to write a component that renders a table with sortable columns. The user didn't specify framework (React, Vue, Angular, etc.) but typically \"component\" im...
[ { "from": "human", "value": "Design a monitoring hook that emits metrics for slow operations." }, { "from": "gpt", "value": "<think>\nWe need to design a monitoring hook that emits metrics for slow operations. This is a relatively open-ended task. The user likely expects a conceptual design or p...
[ { "from": "human", "value": "Build a utility that normalizes whitespace and line endings in text files." }, { "from": "gpt", "value": "<think>\nWe need to build a utility that normalizes whitespace and line endings in text files. The user likely wants a script or program that can read text files...
[ { "from": "human", "value": "Refactor repeated validation rules into reusable schema definitions." }, { "from": "gpt", "value": "<think>\nWe need to understand the user's request. It's a statement: \"Refactor repeated validation rules into reusable schema definitions.\" Likely the user wants gui...
[ { "from": "human", "value": "Create a small worker pool that limits concurrency and reports failures." }, { "from": "gpt", "value": "<think>\nWe need to create a small worker pool that limits concurrency and reports failures. This is a common pattern in Go. The user didn't specify language, but ...
[ { "from": "human", "value": "Build a modal dialog with focus trapping and keyboard dismissal." }, { "from": "gpt", "value": "<think>\nThe user wants me to build a modal dialog with:\n1. Focus trapping (focus cycles within the modal when tabbing)\n2. Keyboard dismissal (Escape key closes the moda...
[ { "from": "human", "value": "Implement an accessible accordion component." }, { "from": "gpt", "value": "<think>\nThe user wants me to implement an accessible accordion component. I'll create a complete, accessible accordion component using HTML, CSS, and JavaScript. I'll follow WCAG guidelines ...
[ { "from": "human", "value": "Create a date picker with min and max constraints." }, { "from": "gpt", "value": "<think>\nThe user wants me to create a date picker with min and max constraints. I'll build a clean, functional date picker component using HTML, CSS, and JavaScript. It should:\n\n1. D...
[ { "from": "human", "value": "Create a skeleton loading screen for a profile page." }, { "from": "gpt", "value": "<think>\nThe user wants me to create a skeleton loading screen for a profile page. I'll create a clean, visually appealing skeleton loading screen using HTML, CSS, and JavaScript. Thi...
[ { "from": "human", "value": "Implement a segmented control for switching views." }, { "from": "gpt", "value": "<think>\nThe user wants me to implement a segmented control for switching views. I'll create a complete, functional segmented control component with view switching functionality using H...
[ { "from": "human", "value": "Create a chart legend that toggles series visibility." }, { "from": "gpt", "value": "<think>\nThe user wants me to create a chart legend that toggles series visibility. I'll create a complete HTML/CSS/JavaScript implementation with a sample chart that has multiple da...