conversations listlengths 2 2 |
|---|
[
{
"from": "human",
"value": "Write a function to check if a given sentence is a pangram. A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence \"The quick brown fox jumps over the lazy dog\" is a pangram, because it uses the letters A-Z at least o... |
[
{
"from": "human",
"value": "Write a function to find the number of distinct palindromic substrings in a given string.\n\nA palindromic string is a string that reads the same backward as forward."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```python\ndef find_palindro... |
[
{
"from": "human",
"value": "Write a Python function to determine if a string is a palindrome and contains only lowercase letters. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward."
},
{
"from": "gpt",
"value": "Here is the code to s... |
[
{
"from": "human",
"value": "Write a function that takes a list of strings as input and returns a list of words that can be formed by concatenating the words in the original list. The concatenated words must be at least twice as long as the original words.\n\nFor example, if the input list is [\"cat\", \"ca... |
[
{
"from": "human",
"value": "Write a python function to check whether a given string is a palindrome or not. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n``... |
[
{
"from": "human",
"value": "Write a function to find the nth heptagonal number. The nth heptagonal number is defined as the number of dots or points that can be arranged within a heptagon (a seven-sided polygon) made up of points equally spaced in a hexagonal grid. The formula for nth heptagonal number is ... |
[
{
"from": "human",
"value": "Write a function to find the frequency of a given pattern in a text string. A pattern is considered to be a sequence of characters that appears in the text string. The function should return the number of times the pattern appears in the text string."
},
{
"from": "gpt",... |
[
{
"from": "human",
"value": "Write a python function to calculate the factorial of a number (a non-negative integer). The factorial of a number is the product of all positive integers less than or equal to that number. Note that the factorial of zero is one."
},
{
"from": "gpt",
"value": "Here i... |
[
{
"from": "human",
"value": "Write a function to check if a string can be transformed into a palindrome by replacing at most one character.\n\nA palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward. In this case, we consider only a string of lowercase... |
[
{
"from": "human",
"value": "Write a function to find the number of black pixels located at some specific row R and column C that align with all the following rules:\n- Row R and column C both contain exactly N black pixels.\n- For all rows that have a black pixel at column C, they should be exactly the sam... |
[
{
"from": "human",
"value": "Write a python function to find the nth digit of the concatenated positive integers sequence.\nThe sequence starts with 1 and concatenated all positive integers in order. For example, the sequence starts as 123456789101112131415..."
},
{
"from": "gpt",
"value": "Here... |
[
{
"from": "human",
"value": "Write a function to check if a string is a palindrome after applying backspace operations. A backspace operation is represented by the '#' character.\n\nA string is considered a palindrome if it reads the same backward as forward after applying the backspace operations."
},
... |
[
{
"from": "human",
"value": "Write a function to determine if a given string is a valid word based on a custom dictionary. A valid word is defined as a word that can be formed by rearranging the letters of one or more words from the dictionary. The dictionary is given as a list of words, and the function sh... |
[
{
"from": "human",
"value": "Write a function to find the minimum element in a given list of numbers. However, the function should not use any built-in functions or methods for finding the minimum value, such as min() or sort(). Instead, the function should implement its own logic to determine the minimum v... |
[
{
"from": "human",
"value": "Write a python function to find the pangram sentence from a list of sentences. A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence \"The quick brown fox jumps over the lazy dog\" is a pangram, because it uses the let... |
[
{
"from": "human",
"value": "Write a python function to generate the next permutation of a given list of integers. If the next permutation is not possible, return the lowest possible order (i.e., sorted in ascending order).\n\nFor example:\n- next_permutation([1, 2, 3]) should return [1, 3, 2]\n- next_permu... |
[
{
"from": "human",
"value": "Write a function to convert a given string to uppercase without using the built-in string method .upper()."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```python\ndef to_upper_case(str):\n upper_case_str = \"\"\n for char in str:\n ... |
[
{
"from": "human",
"value": "Write a function to find the number of distinct subsequences of a given string. A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining character... |
[
{
"from": "human",
"value": "Write a function to find the number of distinct subsequences of a given string.\n\nThe function should take a string as input and return the number of distinct subsequences of that string. A subsequence of a string is a new string generated from the original string with some cha... |
[
{
"from": "human",
"value": "Write a python function to compress a string by collapsing consecutive occurrences of the same character into a single character followed by the number of occurrences. If a character occurs only once, it should not be followed by a number."
},
{
"from": "gpt",
"value... |
[
{
"from": "human",
"value": "Write a function that takes a list of integers as input and returns a list of strings summarizing ranges of consecutive numbers in the input list. If the input list is empty, return an empty list.\n\nFor example:\n- Given nums = [0, 1, 2, 4, 5, 7], the function should return [\"... |
[
{
"from": "human",
"value": "Write a python function to find the number of distinct substrings in a given string. A substring is a contiguous sequence of characters within a string. For example, the string \"abc\" has the following substrings: \"a\", \"b\", \"c\", \"ab\", \"bc\", and \"abc\"."
},
{
... |
[
{
"from": "human",
"value": "Write a python function to check if a number is a self-dividing number. A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. Also, a self-dividing number ... |
[
{
"from": "human",
"value": "Write a function to count the number of valid parentheses strings of length n.\nA parentheses string is valid if:\n- Every open parenthesis '(' is closed by a corresponding close parenthesis ')'.\n- Every close parenthesis ')' is preceded by a corresponding open parenthesis '('.... |
[
{
"from": "human",
"value": "Write a python function to count the number of special substrings in the given string. A special substring is defined as either:\n1. A substring with all identical characters (e.g., \"aaa\").\n2. A substring where all characters except the center one are identical (e.g., \"aba\"... |
[
{
"from": "human",
"value": "Write a function to find the nth centered hexagonal number. A centered hexagonal number is a centered figurate number that represents a hexagon with a dot in the center and all other dots surrounding the center dot in a hexagonal lattice.\n\nThe nth centered hexagonal number can... |
[
{
"from": "human",
"value": "Write a python function to find the number of times a given string can be formed by concatenating a substring of the same string.\n\nFor example, if the string is \"abcabcabc\", the function should return 3 for the substring \"abc\"."
},
{
"from": "gpt",
"value": "He... |
[
{
"from": "human",
"value": "Write a function that takes a string as input and returns the number of different integers that are present in the string. Integers are considered different if they have different values when leading zeros are ignored."
},
{
"from": "gpt",
"value": "Here is the code ... |
[
{
"from": "human",
"value": "Write a python function to check if a string is a valid stack sequence of \"meow\". This means that the string can be formed by repeatedly adding one letter at a time and removing one letter at a time in the correct order of \"meow\". For example, \"mow\" is a valid sequence bec... |
[
{
"from": "human",
"value": "Write a function to check if a number is a double-base palindrome.\nA double-base palindrome is a number that is a palindrome in two bases. For example, 585 is a double-base palindrome because it is palindromic in base 10 (585) and base 2 (1001001001)."
},
{
"from": "gpt... |
[
{
"from": "human",
"value": "Write a function to find the intersection of two lists of intervals. The intervals in the list are represented by a pair of integers [start, end]. The intersection of two intervals is a new interval [max(start1, start2), min(end1, end2)] where start1, end1 are the start and end ... |
[
{
"from": "human",
"value": "Write a python function to find the most frequent character in a string that is not a vowel. If two or more non-vowel characters have the same frequency, return the one that appears first in the string."
},
{
"from": "gpt",
"value": "Here is the code to solve this pr... |
[
{
"from": "human",
"value": "Write a python function to check if the given string is an isogram.\n\nAn isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines if a string that contains only letters is an isogram. Assume the empty string is an iso... |
[
{
"from": "human",
"value": "Write a function that checks if a given word follows the rule of capitalization. A word follows the rule of capitalization if it satisfies one of the following conditions:\n1. All letters in the word are uppercase.\n2. All letters in the word are lowercase.\n3. Only the first le... |
[
{
"from": "human",
"value": "Write a function that takes a string and returns the number of alphabetic characters in it. Alphabetic characters are those that are part of the English alphabet (A-Z, a-z)."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```python\ndef count_... |
[
{
"from": "human",
"value": "Write a python function to find the nth heptagonal number. A heptagonal number is a figurate number that represents a heptagon. The nth heptagonal number is given by the formula: H_n = n(5n - 3)/2, where H_n is the nth heptagonal number."
},
{
"from": "gpt",
"value":... |
[
{
"from": "human",
"value": "Write a function that reverses a doubly linked list.\n\nA doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains three fields: two link fields (references to the previous node and to the next node in t... |
[
{
"from": "human",
"value": "Write a python function to find the number of distinct products obtained by multiplying two numbers from different indices in the array.\n\nFor example, given the array [1, 2, 3, 4], the distinct products are [2, 3, 4, 6, 8, 12]. There are 6 distinct products."
},
{
"fro... |
[
{
"from": "human",
"value": "Write a function that takes in a list of integers and returns the list sorted in ascending order using the insertion sort algorithm.\n\nInsertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on larg... |
[
{
"from": "human",
"value": "Write a python function to find the minimum number of Fibonacci numbers whose sum is equal to a given number. The same Fibonacci number can be used multiple times.\n\nA Fibonacci number is a number that appears in the sequence created by the following recurrence relation:\nF(0) ... |
[
{
"from": "human",
"value": "Write a function to find the number of palindrome substrings in a given string. A palindrome is a string that reads the same backward as forward."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```python\ndef palindromic_substrings(str):\n ... |
[
{
"from": "human",
"value": "Write a function to decode a string that has been encoded using a simple substitution cipher. In this cipher, each letter in the alphabet is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, A would be replaced by B, B would b... |
[
{
"from": "human",
"value": "Write a python function to find the number of island in a given grid map, where 1 represents land and 0 represents water. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all sur... |
[
{
"from": "human",
"value": "Write a function to find the minimum number of operations required to make two strings equal. An operation is defined as replacing a character in one of the strings with any other character."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```p... |
[
{
"from": "human",
"value": "Write a function to convert a string representation of a number in words to an integer. The rules for conversion are as follows:\n- Each word represents a digit from 0 to 9.\n- The words are not case-sensitive.\n- The words are separated by spaces.\n- The words can be in any ord... |
[
{
"from": "human",
"value": "Write a python function to count the number of ways to parenthesize a given arithmetic expression to ensure correct order of operations.\n\nFor example, for the expression \"2*3-4*5\", there are five ways to parenthesize it:\n1. ((2 * 3) - (4 * 5))\n2. ((2 * (3 - 4)) * 5)\n3. (2... |
[
{
"from": "human",
"value": "Write a function to find the number of distinct island shapes in a given grid. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water."
},
{
"from": "gp... |
[
{
"from": "human",
"value": "Write a python function to find the minimum number of characters to change so that one string can become an anagram of another. An anagram is a word or phrase that is made by rearranging the letters of another word or phrase, using all the original letters exactly once."
},
... |
[
{
"from": "human",
"value": "Write a python function to find the minimum number of moves required to convert a given number to 1 by performing the following operations:\n- If the number is even, divide it by 2.\n- If the number is odd, either increment or decrement it by 1."
},
{
"from": "gpt",
... |
[
{
"from": "human",
"value": "Write a function to calculate the score of a word. The score for a word is the sum of the score of its letters. The score of a letter is its position in the English alphabet (a=1, b=2, etc.)."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```... |
[
{
"from": "human",
"value": "Write a function to find the total count of a specific digit appearing in all non-negative integers less than a certain limit.\n\nFor example, if the given limit is 100 and the digit is 1, the function should return the total number of times the digit 1 appears in all non-negati... |
[
{
"from": "human",
"value": "Write a python function to encode a given string using the Run-length encoding algorithm.\n\nRun-length encoding is a simple form of data compression in which runs of data (that is, sequences in which the same data value occurs in many consecutive data elements) are stored as a ... |
[
{
"from": "human",
"value": "Write a function that takes an integer N and returns the count of good numbers from 1 to N. A good number is defined as a number that, after rotating each digit individually by 180 degrees, results in a valid number that is different from the original number. Each digit must be ... |
[
{
"from": "human",
"value": "Write a python function to calculate the number of ways to reach the top of a staircase. You are initially at the bottom of a staircase of N steps. You can either climb one step, two steps, or three steps at a time. Write a function that returns the number of distinct ways to cl... |
[
{
"from": "human",
"value": "Write a function to generate the Lucas series in Python. The Lucas series is a sequence of numbers where each number is the sum of the two preceding ones, starting from 2 and 1. It's similar to the Fibonacci sequence, but with different starting values."
},
{
"from": "gp... |
[
{
"from": "human",
"value": "Write a python function to find the nth centered hexagonal number. A centered hexagonal number or hex number is a centered figurate number that represents a hexagon with a dot in the center and all other dots surrounding the center dot in a hexagonal lattice. The nth centered he... |
[
{
"from": "human",
"value": "Write a function to calculate the maximum possible volume of a cuboid that can be formed from a given rectangular metal sheet. The metal sheet has length L, width W, and height H. We can cut the sheet into six pieces and rearrange them to form a cuboid. The function should retur... |
[
{
"from": "human",
"value": "Write a python function to find the number of unique binary search trees (BSTs) that store values 1...n.\n\nA unique binary tree can be constructed from each permutation of the series 1...n, but many of these will not be unique BSTs. The goal is to find the number of unique BSTs... |
[
{
"from": "human",
"value": "Write a function to count the number of substrings in a given string that are anagrams of a given pattern.\n\nAn anagram of a string is another string that contains the same characters, only the order of characters can be different. \n\nFor example, \"abc\" and \"bca\" are anagr... |
[
{
"from": "human",
"value": "Write a function to check if a given string is a rotation of a palindrome. A palindrome is a word that reads the same backward as forward. A rotation is the operation of moving the last character of the string to the front.\n\nFor example:\n- check_rotation_of_palindrome(\"racec... |
[
{
"from": "human",
"value": "Write a function to find the deepest node in a binary tree.\n\nThe function should take the root of the binary tree as an argument and return the value of the deepest node.\n\nA binary tree is represented as a series of nodes, where each node has a value, and may have a left chi... |
[
{
"from": "human",
"value": "Write a Python function to count the minimum number of swaps required to make an array palindrome.\n\nA palindrome is an array that reads the same backward as forward. You can swap any two elements in the array any number of times. The function should determine the minimum numbe... |
[
{
"from": "human",
"value": "Write a function to check if a string is a pangram. A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence \"The quick brown fox jumps over the lazy dog\" is a pangram, because it uses the letters A-Z at least once (cas... |
[
{
"from": "human",
"value": "Write a python function to find the number of ways to decode a message using the following mapping: 'A' -> 1, 'B' -> 2, ..., 'Z' -> 26. A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1, 'B' -> 2, ..., 'Z' -> 26. Given a non-... |
[
{
"from": "human",
"value": "Write a function to find the minimum number of moves required to convert a string into a palindrome. You can perform the following operations: Insert a character, delete a character or replace a character."
},
{
"from": "gpt",
"value": "Here is the code to solve this... |
[
{
"from": "human",
"value": "Write a function to simulate Conway's Game of Life. Given a 2D board consisting of 1s and 0s, 1 represents a living cell while 0 represents a dead cell. Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules (taken from the a... |
[
{
"from": "human",
"value": "Write a python function to check if a given list of strings is a palindrome when concatenated together.\n\nA palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization)."
},
... |
[
{
"from": "human",
"value": "Write a function to generate sequential digits numbers within a given range.\n\nA sequential digits number is a number that its digits are in a consecutive sequence. For example, 123, 234, 345, 1234, 2345, and 3456 are sequential digits numbers."
},
{
"from": "gpt",
... |
[
{
"from": "human",
"value": "Write a python function that takes a list of strings as input and returns a list of tuples. Each tuple should contain the original string, the length of the string, the number of vowels in the string, and the number of consonants in the string."
},
{
"from": "gpt",
"... |
[
{
"from": "human",
"value": "Write a function to search for a target value in a binary search tree (BST). The BST is represented as a two-dimensional list where each inner list contains the node value, the index of the left child, and the index of the right child. If the target value is found, return True; ... |
[
{
"from": "human",
"value": "Write a function that takes two strings as input. The function should compare the frequency of each character in the two strings. If the frequencies of all characters are the same, the function returns True. Otherwise, it returns False."
},
{
"from": "gpt",
"value": ... |
[
{
"from": "human",
"value": "Write a function to check if a given string is a valid license plate. A valid license plate has the following characteristics:\n- It must be at least 2 characters and at most 6 characters long.\n- It must start with two alphabetic characters.\n- It can contain numeric characters... |
[
{
"from": "human",
"value": "Write a function to find the minimum number of characters to delete to make two strings anagrams of each other.\n\nAn anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, \"abcd\" and \"dabc\" are an... |
[
{
"from": "human",
"value": "Write a function to count the number of distinct integers in a string.\n\nYou are given a string `word` consisting of digits and lowercase English letters. Your task is to count the number of distinct integers that appear in the string. An integer is considered distinct if it ap... |
[
{
"from": "human",
"value": "Create a function that takes a string as input and returns True if it's a valid student attendance record, otherwise returns False. A valid attendance record is defined as a string that doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late)."
},
{
... |
[
{
"from": "human",
"value": "Write a python function to find the number of distinct islands in a 2D binary grid. An island is formed by the connected 1's (representing land) not by the diagonal. Two islands are considered the same if and only if one island can be translated (without rotation) to equal the o... |
[
{
"from": "human",
"value": "Write a python function to find the minimum number of operations required to convert a string into a palindrome. An operation is defined as inserting a character at any position in the string."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n``... |
[
{
"from": "human",
"value": "Write a python function that takes in two integers representing the number of brown and yellow tiles in a rectangular shape. The function should return the dimensions (width and height) of the rectangle. The rectangle has a border made of brown tiles, and the inside is filled wi... |
[
{
"from": "human",
"value": "Write a python function to find the number of ways to decode a message with 'A' = 1, 'B' = 2 ... 'Z' = 26. The input string is a string of digits and you can assume all inputs are valid and only contain digits.\n\nExample 1:\nInput: \"12\"\nOutput: 2\nExplanation: It could be de... |
[
{
"from": "human",
"value": "Write a function to find the number of ways to decode a message using a specific mapping of numbers to letters. The mapping is as follows: 'A' -> 1, 'B' -> 2, ..., 'Z' -> 26. The function should return the number of ways to decode the message."
},
{
"from": "gpt",
"v... |
[
{
"from": "human",
"value": "Write a function that takes a string and returns the minimum number of deletions required to make the string a palindrome.\n\nA palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capit... |
[
{
"from": "human",
"value": "Write a function to check if a given binary tree is a valid binary search tree (BST).\n\nA valid BST is defined as follows:\n- The left subtree of a node contains only nodes with keys less than the node's key.\n- The right subtree of a node contains only nodes with keys greater ... |
[
{
"from": "human",
"value": "Write a function to create a frequency list from a given list of elements. The function should return a list of tuples, where each tuple contains an element from the input list and its frequency in the list."
},
{
"from": "gpt",
"value": "Here is the code to solve th... |
[
{
"from": "human",
"value": "Write a function that takes a list of integers and returns a new list with the greatest common divisor (GCD) of each pair of consecutive elements from the original list.\n\nFor example:\n- If the input list is [12, 15, 6], the function should return [3, 3] because the GCD of 12 ... |
[
{
"from": "human",
"value": "Write a python function that takes a string and a list of words as input and returns the minimum number of extra characters in the string after removing all valid words. A valid word is a word that is present in the list of words and can be formed by concatenating consecutive ch... |
[
{
"from": "human",
"value": "Write a python function to count the number of valid brackets in a given string. A valid bracket is defined as a pair of brackets that are correctly matched and nested. For example, \"()\" and \"(())\" are valid, but \"(()\" and \"())\" are not."
},
{
"from": "gpt",
... |
[
{
"from": "human",
"value": "Write a function to convert a list of characters into a string. The function should also check if the characters in the list form a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward."
},
{
"from": ... |
[
{
"from": "human",
"value": "Write a function to find the number of islands in a given grid. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water."
},
{
"from": "gpt",
"value"... |
[
{
"from": "human",
"value": "Write a python function to find the number of possible combinations of words that can be created using a given set of characters. The function should take a list of words and a string of characters as input and return the number of words that can be created using the given set o... |
[
{
"from": "human",
"value": "Write a function that takes a string and returns the number of different letter cases (upper or lower) for each character in the string."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```python\ndef count_letter_cases(string):\n upper = su... |
[
{
"from": "human",
"value": "Write a function to check if a given string is a rotation of a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward or forward. A rotation of a string is a rearrangement of its characters by moving some of them to the b... |
[
{
"from": "human",
"value": "Write a python function to find the number of distinct binary search trees (BSTs) that can be created with a given number of nodes.\n\nA binary search tree (BST) is a binary tree where for every node, all the nodes in the left subtree have values less than the node's value, and ... |
[
{
"from": "human",
"value": "Write a function that takes a string representing a mathematical expression in reverse Polish notation (RPN) and returns the result of the expression. The expression will consist of integers and the four basic arithmetic operations: +, -, *, and /."
},
{
"from": "gpt",
... |
[
{
"from": "human",
"value": "Write a python function to find the degree of a polynomial represented as a list of coefficients in descending order.\n\nFor example, for the polynomial 3x^2 + 2x + 1, the list of coefficients is [3, 2, 1]. The degree of this polynomial is 2 (the highest power of x)."
},
{
... |
[
{
"from": "human",
"value": "Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits."
},
{... |
[
{
"from": "human",
"value": "Write a function to check if a given word can be found in a 2D board of characters. The word must be formed by sequentially adjacent characters, where \"adjacent\" characters are those horizontally or vertically neighboring. The same letter cell may not be used more than once in... |
[
{
"from": "human",
"value": "Design a function that creates a circular linked list from a given list of elements. A circular linked list is a type of linked list where the last node points back to the first node, creating a loop. Each node in the list should contain the value of the element at the correspon... |
[
{
"from": "human",
"value": "Write a function to find the minimum number of operations required to convert a string to a palindrome. An operation is defined as inserting a single character into the string at any position."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n``... |
[
{
"from": "human",
"value": "Write a python function that will return the number of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits."
... |
[
{
"from": "human",
"value": "Write a Python function to find the number of palindromic substrings in a given string.\n\nA palindromic string is a string that reads the same backward as forward."
},
{
"from": "gpt",
"value": "Here is the code to solve this problem:\n```python\ndef count_Palindrom... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2