/**
 * This function searches for a given target value in a list and returns true if found,
 * otherwise it returns false.
 *
 * @param lst the list to be searched
 * @param target the value to be searched for in the list
 * @return true if target is found in the list, false otherwise
 */
fun findPattern(lst: List<Int>, target: Int): Boolean {

    var start = 0
    var end = lst.size - 1

    while (start <= end) {
        val mid = (start + end) / 2
        when {
            lst[mid] == target -> return true
            lst[mid] < target -> start = mid + 1
            else -> end = mid - 1
        }
    }

    return false
}
/**
 * This function searches for a given target value in a list and returns true if found,
 * otherwise it returns false.
 *
 * @param lst the list to be searched
 * @param target the value to be searched for in the list
 * @return true if target is found in the list, false otherwise
 */
fun findPattern(lst: List<Int>, target: Int): Boolean {
/**
 * This function searches for a given target value in a list and returns true if found,
 * otherwise it returns false.
 *
 * @param lst the list to be searched
 * @param target the value to be searched for in the list
 * @return true if target is found in the list, false otherwise
 */
fun findPattern(lst: List<Int>, target: Int): Boolean {

    var start = 0
    var end = lst.size - 1

    while (start <= end) {
        val mid = (start + end) / 2
        when {
            lst[mid] == target -> return true
            lst[mid] < target -> start = mid + 1
            else -> end = mid - 1
        }
    }

    return false
}