/**
 * As a lawyer specializing in intellectual property, you have been assigned a case related to patent infringement.
 * You need to determine the number of occurrences of the word 'patent' and its variants in the given text.
 *
 * Write a function that takes a text as input and returns the count of the occurrences of the word 'patent'
 * (including variations like 'patents', 'patenting', 'patented', 'patentable', etc.).
 *
 * For example:
 * - If the input text is "The patent was filed yesterday and it will be patented soon.", the function should return 2.
 * - If the input text is "Patentable inventions are crucial to technological advances.", the function should return 1.
 * - If the input text is "The patents office is responsible for patenting new ideas.", the function should return 2.
 *
 * You can assume that the input text uses lowercase and is free from punctuation marks, except for the space character.
 */
fun countPatents(text: String): Int {

    val count = text.split(" ").count { it in setOf("patent", "patents", "patenting", "patented", "patentable") }
    return count
}
/**
 * As a lawyer specializing in intellectual property, you have been assigned a case related to patent infringement.
 * You need to determine the number of occurrences of the word 'patent' and its variants in the given text.
 *
 * Write a function that takes a text as input and returns the count of the occurrences of the word 'patent'
 * (including variations like 'patents', 'patenting', 'patented', 'patentable', etc.).
 *
 * For example:
 * - If the input text is "The patent was filed yesterday and it will be patented soon.", the function should return 2.
 * - If the input text is "Patentable inventions are crucial to technological advances.", the function should return 1.
 * - If the input text is "The patents office is responsible for patenting new ideas.", the function should return 2.
 *
 * You can assume that the input text uses lowercase and is free from punctuation marks, except for the space character.
 */
fun countPatents(text: String): Int {
/**
 * As a lawyer specializing in intellectual property, you have been assigned a case related to patent infringement.
 * You need to determine the number of occurrences of the word 'patent' and its variants in the given text.
 *
 * Write a function that takes a text as input and returns the count of the occurrences of the word 'patent'
 * (including variations like 'patents', 'patenting', 'patented', 'patentable', etc.).
 *
 * For example:
 * - If the input text is "The patent was filed yesterday and it will be patented soon.", the function should return 2.
 * - If the input text is "Patentable inventions are crucial to technological advances.", the function should return 1.
 * - If the input text is "The patents office is responsible for patenting new ideas.", the function should return 2.
 *
 * You can assume that the input text uses lowercase and is free from punctuation marks, except for the space character.
 */
fun countPatents(text: String): Int {

    val count = text.split(" ").count { it in setOf("patent", "patents", "patenting", "patented", "patentable") }
    return count
}