Leetcode Hard Problem, Simplest Solution Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should Read more →
Python Programs
35 postsGiven a dictionary, repeat elements K times where K is key of dictionary. Examples : Input : test_dict = {4 : 5, 7 : 2, 9 : 6, 10 : 4} Output Read more →
You are given an integer array which is sorted in non-decreasing order. Build and return an integer array result with the same length as the integer array such that result[i] is equal Read more →
A string is called happy if it does not have any of the strings ‘aaa’, ‘bbb’ or ‘ccc’ as a substring. Given three integers a, b and c, return any string s, Read more →
Given dictionary, sort its items using key-value difference. Input : test_dict = {3 : 9, 1 : 4, 9 : 13, 1 : 10, 8 : 9 } Output : {8: 9, Read more →
In this problem a string is given, our task is to check the string contains even number of 1’s and odd number 0’s or not. Examples: Input : "101010100" Output : Accept Read more →
Considering a clique of n vertices. Determine if it is possible to divide the set of vertices into two equal halves such that there is an edge between any two vertices of Read more →
In Python, dictionary is a collection which is unordered, changeable and indexed. Dictionaries are written with curly brackets, and they have keys and values. It is used to hash a particular key. Read more →
Given a statement(string), the task is to check if that string contains any word which contains ‘a’ in it then print that word otherwise print no any word containing ‘a’ in the Read more →
In this problem a string is given, our task is to check the string is binary string or not. Examples: Input : '01010101010' Output : Accepted Input : 'w3colleges101' Output : Not Read more →