```\n    function getMedianPriceIfDeviation(\n        uint256[] memory prices_,\n        bytes memory params_\n    ) public pure returns (uint256) {\n        // Misconfiguration\n        if (prices_.length < 3) revert SimpleStrategy_PriceCountInvalid(prices_.length, 3);\n\n237     uint256[] memory nonZeroPrices = _getNonZeroArray(prices_);\n\n        // Return 0 if all prices are 0\n        if (nonZeroPrices.length == 0) return 0;\n\n        // Cache first non-zero price since the array is sorted in place\n        uint256 firstNonZeroPrice = nonZeroPrices[0];\n\n        // If there are not enough non-zero prices to calculate a median, return the first non-zero price\n246     if (nonZeroPrices.length < 3) return firstNonZeroPrice;\n\n        uint256[] memory sortedPrices = nonZeroPrices.sort();\n\n        // Get the average and median and abort if there's a problem\n        // The following two values are guaranteed to not be 0 since sortedPrices only contains non-zero values and has a length of 3+\n        uint256 averagePrice = _getAveragePrice(sortedPrices);\n253     uint256 medianPrice = _getMedianPrice(sortedPrices);\n\n        if (params_.length != DEVIATION_PARAMS_LENGTH) revert SimpleStrategy_ParamsInvalid(params_);\n        uint256 deviationBps = abi.decode(params_, (uint256));\n        if (deviationBps <= DEVIATION_MIN || deviationBps >= DEVIATION_MAX)\n            revert SimpleStrategy_ParamsInvalid(params_);\n\n        // Check the deviation of the minimum from the average\n        uint256 minPrice = sortedPrices[0];\n262     if (((averagePrice - minPrice) * 10000) / averagePrice > deviationBps) return medianPrice;\n\n        // Check the deviation of the maximum from the average\n        uint256 maxPrice = sortedPrices[sortedPrices.length - 1];\n266     if (((maxPrice - averagePrice) * 10000) / averagePrice > deviationBps) return medianPrice;\n\n        // Otherwise, return the first non-zero value\n        return firstNonZeroPrice;\n    }\n```\n