Monday, 4 May 2020

Ransom Note | Python

Python for beginners: https://www.youtube.com/watch?v=egq7Z... Code: class Solution:     def canConstruct(self, ransomNote: str, magazine: str) -> bool:         g=0;         for i in ransomNote:             t=ransomNote.count(i);          ...

Search Insert Position | Python

Python for beginners: https://www.youtube.com/watch?v=egq7Z... Code: class Solution:     def searchInsert(self, nums: List[int], target: int) -> int:         if(target in nums):             return nums.index(target);         else:      ...

Intersection of Two Arrays | Python

Check the problem statement here: The intersection of Two Arrays: https://leetcode.com/problems/interse... Python for beginners: https://www.youtube.com/watch?v=egq7Z... Code: class Solution:     def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:         output=[];        ...

Jewels and Stones | Python

Prerequisites for solving this particular question: String Immutability & count method | Python | Castor Classes https://www.youtube.com/watch?v=Am1vX... Iterate over a list & string | List in Python | Part 4 | Castor Classes https://www.youtube.com/watch?v=4Zrfk... You can get the problem statement here: https://leetcode.com/problems/jewels-... Python...

If Expressions in Python

Prerequisite: if else command | Python  https://www.youtube.com/watch?v=9GJWK... Java code used in this video: import java.util.*; public class Hello { public static void main(String args[]) {  Scanner obj=new Scanner(System.in);  int x=obj.nextInt();  String s=(x%2==0)?"Even":"Odd";  System.out.println(s); } } Python...

None value in Python

Python for beginners:  https://www.youtube.com/watch?v=egq7Z... Telegram: https://t.me/clcoding_python https://www.facebook.com/pirawenpython/ https://www.facebook.com/groups/piraw... (adsbygoogle = window.adsbygoogle || []).push({}); (adsbygoogle = window.adsbygoogle || []).push({})...

Separate 0’s and 1’s in an array | Python

Python for beginners:  https://www.youtube.com/watch?v=egq7Z.. Code: l=int(input()); i=0; m=[]; zeros=0; while(i<l):     y=int(input());     if(y==0):         zeros+=1;     m.append(y);     i+=1; i=0; while(i<l):     if(i<zeros):      ...

Find first set bit | Python

Python for beginners: https://www.youtube.com/watch?v=egq7Z... Code: t=int(input()); i=0; while(i<t):     a=int(input());     rs=bin(a)[2:];     y=list(rs);     y.reverse();     if('1' in y):         io=y.index('1');         print(io+1);    ...

Sunday, 3 May 2020

Saturday, 2 May 2020

Prime Number of Set Bits in Binary Representation | Python

Prerequisite: Brian Kernighan’s Algorithm | Python | Castor Classes https://www.youtube.com/watch?v=DUSCd... Python for beginners: https://www.youtube.com/watch?v=egq7Z... Telegram: https://t.me/clcoding_python https://www.facebook.com/pirawenpython/ (adsbygoogle = window.adsbygoogle || []).push({}); (adsbygoogle = window.adsbygoogle...

Move Zeroes | Python

Code: class Solution: def moveZeroes(self, nums: List[int]) -> None: g=nums.count(0); i=0; while(i<g): nums.remove(0); nums.append(0); i=i+1; Python for beginners: https://www.youtube.com/watch?v=egq7Z... Telegram: https://t.me/clcoding_python https://www.facebook.com/pirawenpython/...

Counting Elements | Python

Code : class Solution: def countElements(self, arr: List[int]) -> int: output=0; for i in arr: if(i+1 in arr): output+=1; return output; Python for beginners: https://www.youtube.com/watch?v=egq7Z.. Telegram: https://t.me/clcoding_python (adsbygoogle = window.adsbygoogle ||...

Program to find whether a no is power of two or not | Python

Prerequisite: Data Type Conversion | Python | Castor Classes https://www.youtube.com/watch?v=z8yw6... Turn off the rightmost set bit | Python | Castor Classes https://www.youtube.com/watch?v=ol4VW... Relationship between binary representation of n & n-1 | Python | Castor Classes https://www.youtube.com/watch?v=iTxc9... Python for beginners: https://www.youtube.com/watch?v=egq7Z.. Telegram:...

Friday, 1 May 2020

Thursday, 30 April 2020

Turn off the rightmost set bit | Python

Question: Write a program that unsets the rightmost set bit of an integer. Input: 12 Output: 8 Input: 7 Output: 6 Simple code: n=int(input()); print(n & (n-1)) Prerequisite: Data Type Conversion | Python | Castor Classes https://www.youtube.com/watch?v=z8yw6... Relationship between binary representation of n & n-1 | Python | Castor...

Popular Posts

Categories

100 Python Programs for Beginner (98) AI (40) Android (24) AngularJS (1) Api (2) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (198) C (77) C# (12) C++ (83) Course (67) Coursera (251) Cybersecurity (25) Data Analysis (3) Data Analytics (3) data management (11) Data Science (149) Data Strucures (8) Deep Learning (21) Django (16) Downloads (3) edx (2) Engineering (14) Euron (29) Events (6) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Generative AI (11) Google (36) Hadoop (3) HTML Quiz (1) HTML&CSS (47) IBM (30) IoT (1) IS (25) Java (93) Java quiz (1) Leet Code (4) Machine Learning (85) Meta (22) MICHIGAN (5) microsoft (4) Nvidia (4) Pandas (4) PHP (20) Projects (29) pyth (1) Python (1055) Python Coding Challenge (461) Python Quiz (128) Python Tips (5) Questions (2) R (70) React (6) Scripting (3) security (3) Selenium Webdriver (4) Software (17) SQL (42) UX Research (1) web application (8) Web development (4) web scraping (2)

Followers

Python Coding for Kids ( Free Demo for Everyone)