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 -
Java 2022-03-17 15:10:39
usaco why did the cow cross the road iii silver java
//sample input 3 3 3 2 2 2 3 3 3 3 2 3 3 2 3 3 3 2 2 2 3 //CODE (2021/1/18) YY/MM/DD import java.util.*; import java.io.*; public class Main { static field[][] farm; public static void main(String[] args) throws Exception { Scanner sc = new S... 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 -
Java 2022-03-11 09:20:22
spring tcp inbound-outbound channel adapter example
@Configuration() @EnableIntegration @IntegrationComponentScan public class ServerConfiguration implements ApplicationListener<TcpConnectionEvent> { private final int port = SocketUtils.findAvailableServerSocket(5000); @MessagingGateway(defaultRequ... Add solution