private static int searchIntervals(int[] nums) {
int sum = 0;
for (int i = 0; i < nums.length - 1; i++) {
if (nums[i] > nums[i + 1]) {
sum++;
int cntr = 0;
for (int h = i+1; h < nums.length - 1 - i; h++) {
cntr++;
if (nums[h] > nums[h + 1]) continue;
else break;
}
i+=cntr;
}
}
return sum;
}
include_once 'dbconnect.php';
<?php
error_reporting( E_ALL & ~E_DEPRECATED & ~E_NOTICE );
if(!mysql_connect("localhost","root",""))
{
die('oops connection problem ! --> '.mysql_error());
}
if(!mysql_select_db("YOUR_DB"))
{
die('oops database selection problem ! --> '.mysql_error());
}
?>