Skip to main content
deleted 9 characters in body
Source Link

Java8

Using the new IntStream stuff, this becomes essentially a one liner, if you ignore the obligatory Java Framework stuff:

import java.util.stream.IntStream; public class A{ public static void main(String[] args){ System.out.println(IntStream.rangeClosed(Integer.parseInt(args[0], Integer.parseInt(args[1])).filter(x -> ((Integer)x).toString().contains(args[2])).toArraycount().length); } } 

It can be run herehere, although I did have to hardcode the values.

Java8

Using the new IntStream stuff, this becomes essentially a one liner, if you ignore the obligatory Java Framework stuff:

import java.util.stream.IntStream; public class A{ public static void main(String[] args){ System.out.println(IntStream.rangeClosed(Integer.parseInt(args[0], Integer.parseInt(args[1])).filter(x -> ((Integer)x).toString().contains(args[2])).toArray().length); } } 

It can be run here, although I did have to hardcode the values.

Java8

Using the new IntStream stuff, this becomes essentially a one liner, if you ignore the obligatory Java Framework stuff:

import java.util.stream.IntStream; public class A{ public static void main(String[] args){ System.out.println(IntStream.rangeClosed(Integer.parseInt(args[0], Integer.parseInt(args[1])).filter(x -> ((Integer)x).toString().contains(args[2])).count()); } } 

It can be run here, although I did have to hardcode the values.

Source Link

Java8

Using the new IntStream stuff, this becomes essentially a one liner, if you ignore the obligatory Java Framework stuff:

import java.util.stream.IntStream; public class A{ public static void main(String[] args){ System.out.println(IntStream.rangeClosed(Integer.parseInt(args[0], Integer.parseInt(args[1])).filter(x -> ((Integer)x).toString().contains(args[2])).toArray().length); } } 

It can be run here, although I did have to hardcode the values.