Mithlesh Upadhyay

Mithlesh Upadhyay is a Computer Science and AI expert from Madhya Pradesh with strong academic background (BE in CSE and M.Tech in AI) and over six years of experience in technical content development. He has contributed tech articles, led teams, and worked in Full Stack Development and Data Science. He founded the w3colleges.org portal for learning resources.

Author Archives: Mithlesh Upadhyay

Compare Two Lists

In dart programming, Lists are used for the collection of data. We declare just variables instead of declaring a separate variable for each value of the collection. Lists are indexable so that we access the values using index ( starts from 0 ). In this article, we will see how to compare two Lists in the dart.  For… Read More »

Convert Number n to 1 in Minimum Steps

Given a number n (n>=1 && n<=1018), your task is to convert it to 1 in minimum operation and constant space and time complexity. In one operation you can either – Subtract 1 from n if n>1. (or) Divide n by one of its proper divisor. Examples:- Input: n=2 Output: 1 2–>1. first move:- subtract 1 from n… Read More »

Default Parameters in Python Functions

A default parameter is a value provided in function declaration that is automatically assigned by the compiler if caller of the function doesn’t provide a value for the parameter with default value. Following is a simple Python example to demonstrate use of default parameters. We don’t have to write 3 Multiply functions, only one function works by using… Read More »

Check if given string contains Even 1’s and Odd 0’s

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 Input : “111001010101” Output : Not Accept Approach used in function: we firstly declare set s which contain ‘0’ and ‘1’ and create set of the… Read More »