What do you want to save?
Add Code snippet
New code examples
-
C# 2022-03-27 16:05:25
Find Number of Repetitions of Substring
using System; using System.Linq; public class Program { public static int NumberOfRepeats(string str) { int length = str.Length; int checkLength = 2; while (checkLength < length) { if (length % checkLength == 0) { var times ... Add solution -
TypeScript 2022-03-27 15:55:26
Given an array, A, of integers, print N's elements in reverse order as a single line of space-separated numbers.
static int[] reverseArray(int[] array) { int end = array.length-1; for(int i=end; i>=0; i--) { a[i] = a[i] + " "; } return String.valueOf(a); } Add solution -
C++ 2022-03-25 00:20:07
clase estatica c++
class MyClass { public: static int var; //Declaración de una variable 'static' static void oneMethod(); //Declaración de un método 'static' }; int MyClass::var = 100; //Definición de la variable 'static' void MyClass::one... Add solution -
C++ 2022-03-13 06:15:02
static inside local scope in c++
#include<iostream> //Singleton class is a class having only one instance class SingleTon { public: static SingleTon& Get() { static SingleTon s_Instance; return s_Instance; }//there is only one instance of static functions and variables a... Add solution -
TypeScript 2022-03-11 15:50:02
DISTINQUISH BETWEEN THE AVERAGE CASE AND WORSE CASE RUNNING TIME AND THE FACTORS AFFECTING THAT AFFECTS THE RUNNING TIME OF AN ALGORITHM
// Return position of largest value in integer array A static int largest(int[] A) { int currlarge = 0; // Position of largest element seen for (int i=1; i<A.length; i++) // For each element if (A[currlarge] < A[i]) // if A... Add solution -
Other 2022-02-24 22:00:15
static vs instance
static or class method 1) A method that is declared as static is known as the static method 2) We don't need to create the objects to call the static methods 3) Non-static (instance) members cannot be accessed in static context (static method, static blo... Add solution -
Java 2022-02-22 20:10:19
Multiply two numbers without using arithmetic operators in java
import java.util.Scanner; public class MultiplyWithoutArithmeticOperators { static int multiplyNumber(int num1, int num2) { int output = 0; boolean boolNegative = (num1 < 0 && num2 >= 0) || (num2 < 0 && num1 >... Add solution -
Java 2022-02-21 18:05:17
admob preload ad
** * Created by Kirk-Patrick Brown on 10/26/2017. */ public class AdManager { private static AdManager singleton; public AdManager() { } /*** * returns an instance of this class. if singleton is null create an instance * else return the current ins... Add solution