 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 812 of 2650
 
 
			
			186 Views
Suppose we are given three integer numbers c, m, and n. We have to generate an infinite sequence, where the first value is 0, the second value is c, and from the third value onwards it is equal to ki = (ki-2 + ki-1) mod m. We have to generate all the values in the series up to item k2n+1. Now from the values of the series; we take two consecutive values in the sequence as the x and y coordinates of a two-dimensional vector and generate n number of vectors. Point to be noted, we use the values in ... Read More
 
 
			
			318 Views
Suppose we are given two integer numbers m and a. Now n = p1(a + 1) *p2(a + 2) *...*pm(a + m), where pi is the i-th prime number and i > 0. We have to find the value of k, where k = summation of f(x) values of n. Here f(x) values are the number of divisor values of each divisor of n.So, if the input is like m = 2, a = 1, then the output will be 60.So, n = 2^2 x 3^3n = 4 x 27n = 108The divisors of 108 are: 1, 2, 3, 4, ... Read More
 
 
			
			1K+ Views
Suppose we are given five integer numbers a, b, c, d, n. We have to find out ((ab)(cd)) mod n. The output value is an integer number.So, if the input is like a = 2, b = 3, c = 2, d = 4, n = 10, then the output will be 6.2^3 = 8 2^4 = 16 8^16 = 281474976710656 281474976710656 mod 10 = 6To solve this, we will follow these steps −Define a function helper() . This will take np := ni := 2while i * i 1, thenp := p - floor value of (p / ... Read More
 
 
			
			176 Views
To check whether the interval is closed on the left-side, right-side, both or neither, use the interval.closed property.At first, import the required libraries −import pandas as pdClosed interval set using the "closed" parameter with value "both". A closed interval (in mathematics denoted by square brackets) contains its endpoints, # i.e. the closed interval [0, 5] is characterized by the conditions 0
 
 
			
			219 Views
Suppose we are given a string and an integer k. The string is repeated k times and made to another string. Our task is to find the length of the substring in the new string where 2 * (number of zeroes in substring) 0: continue else: a = min(k - 1, -tmp // list_a[str_len]) v = a * list_a[str_len] - list_a[i] b = bisect_left(list_b, (-v + 1, 0)) - 1 res = max(res, temp_list[b] - i + a * str_len) return res print(solve(2, '0101011'))Input2, '0101011'Output14
 
 
			
			428 Views
Suppose we are given two integer numbers p and q. We have to find out the value of 22^p mod q. The output has to be an integer.So, if the input is like p = 5, q = 6, then the output will be 4To solve this, we will follow these steps −res := 2^(2^p) mod qreturn resExampleLet us see the following implementation to get better understanding −def solve(p, q): res = pow(2, 2 ** p, q) return res print(solve(5, 6))Input5, 6Output4
 
 
			
			2K+ Views
Suppose we are given a range of integer numbers and are asked to find out the special numbers in the range. A special number is a number that is a positive integer having only 1 digit in its decimal representation. A number that has more than 1 digit in its decimal representation can also be special if the number is divisible by the count of digits in its decimal representation and the quotient value is itself a special number. We return the count of special numbers in the given range (left_limit, right_limit).So, if the input is like left_limit = 5, ... Read More
 
 
			
			143 Views
To create a half-closed time interval, use the pandas.Interval() and set the closed parameter to right. To check for existence of endpoints, use the in property.At first, import the required libraries −import pandas as pdHalf-Closed interval set using the "closed" parameter with value "right". Half-Closed i.e. (0, 5] is described by 0 < x
 
 
			
			347 Views
To create a half-open time interval, use the pandas.Interval() and set the closed parameter to left. To check for existence of endpoints, use the in property.At first, import the required libraries −import pandas as pdHalf-Open interval set using the "closed" parameter with value "left". Half-open i.e. [0, 5) is described by 0